Interface Engine


public interface Engine
This is the central point of controlling the ScrewBox-Engine. Grants access to all public subsystems.
See Also:
  • Method Details

    • assets

      Assets assets()
      Loads your game Assets. Used to avoid stutter due to in game loading.
    • environment

      Environment environment()
      Returns the games Entity management system (Environment). This is where all the game logic and objects are kept.
    • loop

      Loop loop()
      Provides access to current performance metrics and to controls the target frames per second.
    • graphics

      Graphics graphics()
      Provides access to the Graphics, which has methods for drawing on screen, changing the GraphicsConfiguration, to update and read the Graphics.camera().
    • keyboard

      Keyboard keyboard()
      Retrieve information about the current Keyboard state.
      See Also:
    • scenes

      Scenes scenes()
      Use Scenes to structure different game situations.
      See Also:
    • audio

      Audio audio()
      Controls the audio playback of the Engine.
    • physics

      Physics physics()
      Advanced searching for entities, pathfinding, raycasting and adjusting Entites to a Grid.
    • particles

      Particles particles()
      Add particle effects to create some nice visuals.
    • mouse

      Mouse mouse()
      Subsystem for getting Information on the Mouse.
    • ui

      Ui ui()
      Create simple ingame menus.
    • async

      Async async()
      Execute long running tasks within the Engine.
    • log

      Log log()
      Provides some super basic logging features and the ability to pick up engine log events via Log.setAdapter(LoggingAdapter) (log.LoggingAdapter)}.
      See Also:
    • window

      Window window()
      Used to control the game window and retrieve information about the game window.
    • start

      void start()
      Starts the Engine. This opens the game Window and starts the Loop. The Engine can be stopped by calling stop() from within an EntitySystem or a UiMenu.
    • stop

      void stop()
      Stops a running Loop and closes the game Window. Can be called from within an EntitySystem or a UiMenu.
    • name

      String name()
      Returns the name of the Engine.
    • version

      String version()
      Returns the version of the used ScrewBox runtime. Will return '0.0.0 (dev-mode)' when working directly with ScrewBox source.
    • isWarmedUp

      boolean isWarmedUp()
      Returns true if the engine has reached a certain speed for once. Once it is true it will never switch back to false. Will also return true after a certain amount of time so that slow machines wont have any issue. This mainly covers JVM warmup and can be used to wait before starting the real business of your game.