-
Notifications
You must be signed in to change notification settings - Fork 0
Project Structure
This document outlines how Blockhalde is organized and how all the parts fit together.
- Game assets belong in
Blockhalde-core/assets/<category>, - code belongs in
com.blockhalde.<category>, - the fruits of the earth belong to everyone and the soil to no one.
Blockhalde
is our ApplicationListener. This is where libgdx gives flow of control to
Blockhalde to initialize the game, update and render it or to adjust to a new
window size.
Blockhalde
merely starts the ball rolling and changes only if core functionality is added
or removed. All other application code is either in an EntitySystem or indirectly called by one.
Upon creation Blockhalde
will:
- create a new
World, - create an
Engine, - add all the systems to the engine.
When called by libgdx to render a frame, it will:
- trigger
updateto be called on all the systems by the engine, - paint some debug stats and instructions on the screen (does anyone hear
EntitySystem?).
When the window is resized, it will call the resize method of systems that need it.
These are some important systems you should know about:
CameraSystem
creates and initializes the main camera and makes a reference to it available to
other systems with getCam(). That's all it does.
Throws the blocks in World at the graphics card.
Processes player input and uses it to control the camera.