Skip to content

Project Structure

Philipp Stadler edited this page Nov 30, 2016 · 1 revision

This document outlines how Blockhalde is organized and how all the parts fit together.

Put what where?

  • 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.

Flow

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.

Blockhalde

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 update to 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.

Known Systems

These are some important systems you should know about:

CameraSystem

CameraSystem creates and initializes the main camera and makes a reference to it available to other systems with getCam(). That's all it does.

RenderSystem

Throws the blocks in World at the graphics card.

InputSystem

Processes player input and uses it to control the camera.

Clone this wiki locally