Package io.github.srcimon.screwbox.core
Interface Engine
public interface Engine
This is the central point of controlling the ScrewBox-Engine. Grants access
to all public subsystems.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionassets()
Loads your gameAsset
s.async()
Execute long running tasks within theEngine
.audio()
Controls the audio playback of theEngine
.Returns the gamesEntity
management system (Environment
).graphics()
Provides access to theGraphics
, which has methods for drawing on screen, changing theGraphicsConfiguration
, to update and read theGraphics.cameraPosition()
and to adjust theWindow
.boolean
Returns true if the engine has reached a certain speed for once.keyboard()
Retrieve information about the currentKeyboard
state.log()
Provides some super basic logging features and the ability to pick up engine log events viaLog.setAdapter(LoggingAdapter)
(log.LoggingAdapter)}.loop()
Provides access to current performance metrics and to controls the target frames per second.mouse()
Subsystem for getting Information on the Mouse.name()
Returns the name of theEngine
.physics()
Advanced searching for entities, pathfinding, raycasting and adjusting Entites to aGrid
.scenes()
UseScenes
to structure different game situations.void
start()
Starts theEngine
.void
void
stop()
ui()
Create simple ingame menus.window()
Used to control the game window and retrieve information about the game window.
-
Method Details
-
assets
Assets assets()Loads your gameAsset
s. Used to avoid stutter due to in game loading. -
environment
Environment environment()Returns the gamesEntity
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 theGraphics
, which has methods for drawing on screen, changing theGraphicsConfiguration
, to update and read theGraphics.cameraPosition()
and to adjust theWindow
. -
keyboard
Keyboard keyboard()Retrieve information about the currentKeyboard
state.- See Also:
-
scenes
Scenes scenes()UseScenes
to structure different game situations.- See Also:
-
audio
Audio audio()Controls the audio playback of theEngine
. -
physics
Physics physics()Advanced searching for entities, pathfinding, raycasting and adjusting Entites to aGrid
.- See Also:
-
mouse
Mouse mouse()Subsystem for getting Information on the Mouse.- See Also:
-
ui
Ui ui()Create simple ingame menus. -
async
Async async()Execute long running tasks within theEngine
. -
log
Log log()Provides some super basic logging features and the ability to pick up engine log events viaLog.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 theEngine
. This opens the gameWindow
and starts theLoop
. TheEngine
can be stopped by callingstop()
from within anEntitySystem
or aUiMenu
.- See Also:
-
start
Starts theEngine
with the givenScene
. This opens the gameWindow
and starts theLoop
. TheEngine
can be stopped by callingstop()
from within anEntitySystem
or aUiMenu
.- See Also:
-
stop
void stop()Stops a runningLoop
and closes the gameWindow
. Can be called from within anEntitySystem
or aUiMenu
. -
name
String name()Returns the name of theEngine
. -
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.
-