Skip to content

Basic Concepts 0.8 release

Thomas Cashman edited this page Aug 16, 2013 · 1 revision

Mini2Dx was inspired by the Slick game development library and uses some concepts similarly. In this article we'll explore the concepts mini2Dx uses.

The Game Loop

All games are essentially broken into 3 operations: initialise, update and render. You'll see this implemented in our tutorials.

Initialise

This is run when the game starts and is only called once. Here you'll create any required objects and load any resources needed for your game. After the initialise method is finished, the update and render methods are called continuously until the game ends.

Update

This is where your game will apply game logic, update animations, change background music, etc. The variable called 'delta' is provided and represents the amount of time in seconds since the last update.

Render

This is where you'll draw you game to the screen.

Dependency Injection

Dependency Injection is often used in enterprise applications via frameworks such as Spring or Guice. However it solves a problem often encountered in video game development:

"Where and when should I connect my components together?"

In mini2Dx you can define your objects at the beginning of your game and connect them together using annotations. This is also useful for swapping component implementations for different platforms. This is further explained in the Dependency Injection Tutorial.

Clone this wiki locally