Class GameLoop

java.lang.Object
ActiverseEngine.GameLoop
All Implemented Interfaces:
Runnable

public class GameLoop extends Object implements Runnable
Represents a highly parallelized game loop maximizing CPU usage while maintaining stability. Threads are split across update/render responsibilities with precise frame pacing.
Version:
1.4.1
Author:
Knivier
  • Constructor Details

    • GameLoop

      public GameLoop(World world)
  • Method Details

    • start

      public void start()
      Starts the game loop on separate threads for update and render. This method initializes the threads and begins the game loop.
    • stop

      public void stop()
      Stops the game loop and waits for threads to finish. This method safely terminates the update and render threads,
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • getTargetFps

      public long getTargetFps()
      Returns the target frames per second (FPS) for the game loop. This value is loaded from the properties file or defaults to 60 FPS.
      Returns:
      the target FPS
    • isDynamicLighting

      public boolean isDynamicLighting()
      Returns whether dynamic lighting is enabled in the game loop. This value is loaded from the properties file or defaults to false.
      Returns:
      true if dynamic lighting is enabled, false otherwise