java.lang.Object
javafx.application.Application
dev.aurumbyte.sypherengine.core.SypherEngine
public class SypherEngine
extends javafx.application.Application
The main class, the heart of the game engine, where everything is run
- Since:
- v0.3.0
- Author:
- AurumByte
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.application.Application
javafx.application.Application.Parameters -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static floatThe fixed number times the engine updates(package private) static floatFrames Per Second(package private) static GameManagerThe Game, The only entrypoint into the engine's inner workings(package private) static intThe width and height of the screenThe KeyListenerThe MouseListener(package private) RendererThe Renderer(package private) javafx.scene.SceneThe Scene(package private) static StringThe Game window title(package private) static intThe width and height of the screenFields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the loggerGets the rendererjavafx.scene.ScenegetScene()Gets the sceneintGets the screen heightintGets the screen widthstatic voidinit(GameManager game) Initializing the engine with a gamestatic voidinit(GameManager game, EngineConfig config) Initializing the engine with a game and a configstatic voidinit(GameManager game, String title) Initializing the engine with a game and a game titlestatic voidRuns the enginevoidstart(javafx.stage.Stage stage) The main game loopMethods inherited from class javafx.application.Application
getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop
-
Field Details
-
keyListener
The KeyListener -
mouseListener
The MouseListener -
renderer
Renderer rendererThe Renderer -
scene
javafx.scene.Scene sceneThe Scene -
fps
static float fpsFrames Per Second -
fixedUpdate
static float fixedUpdateThe fixed number times the engine updates -
game
The Game, The only entrypoint into the engine's inner workings -
title
The Game window title -
width
static int widthThe width and height of the screen -
height
static int heightThe width and height of the screen
-
-
Constructor Details
-
SypherEngine
public SypherEngine()
-
-
Method Details
-
start
The main game loop
- Specified by:
startin classjavafx.application.Application- Parameters:
stage- The main stage- Throws:
IOException- IOException- Since:
- v0.3.0
-
init
Initializing the engine with a game
- Parameters:
game- the game to be run- Since:
- v0.3.0
-
init
Initializing the engine with a game and a game title
- Parameters:
game- the game to be runtitle- the title of the game- Since:
- v0.3.0
-
init
Initializing the engine with a game and a config
- Parameters:
game- the game to be runconfig- the configuration by which the game should be run- Since:
- v0.3.0
-
getRenderer
Gets the renderer- Since:
- v0.3.0
-
getScreenHeight
public int getScreenHeight()Gets the screen height- Since:
- v0.3.0
-
getScreenWidth
public int getScreenWidth()Gets the screen width- Since:
- v0.3.0
-
getLogger
Gets the logger- Since:
- v0.3.0
-
getScene
public javafx.scene.Scene getScene()Gets the scene- Since:
- v0.3.0
-
run
Runs the engine- Parameters:
args- The arguments by which to run the game- Since:
- v0.3.0
-