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.camera()
.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 theMouse
.name()
Returns the name of theEngine
.Add particle effects to create some nice visuals.physics()
Advanced searching for entities, pathfinding, raycasting and adjusting Entites to aGrid
.scenes()
UseScenes
to structure different game situations.void
start()
Starts theEngine
.void
stop()
ui()
Create simple ingame menus.version()
Returns the version of the usedScrewBox
runtime.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.camera()
. -
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
. -
particles
Particles particles()Add particle effects to create some nice visuals. -
mouse
Mouse mouse()Subsystem for getting Information on theMouse
. -
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() -
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
. -
version
String version() -
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.
-