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
Modifier and TypeFieldDescription(package private) static float
The fixed number times the engine updates(package private) static float
Frames Per Second(package private) static GameManager
The Game, The only entrypoint into the engine's inner workings(package private) static int
The width and height of the screenThe KeyListenerThe MouseListener(package private) Renderer
The Renderer(package private) javafx.scene.Scene
The Scene(package private) static String
The Game window title(package private) static int
The width and height of the screenFields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the loggerGets the rendererjavafx.scene.Scene
getScene()
Gets the sceneint
Gets the screen heightint
Gets the screen widthstatic void
init
(GameManager game) Initializing the engine with a gamestatic void
init
(GameManager game, EngineConfig config) Initializing the engine with a game and a configstatic void
init
(GameManager game, String title) Initializing the engine with a game and a game titlestatic void
Runs the enginevoid
start
(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:
start
in 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
-