Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 63 lines (34 sloc) 4.102 kB
50428ae @atombender Big refactoring.
authored
1 # Brick
82db46c More work.
Alexander Staubo authored
2
50428ae @atombender Big refactoring.
authored
3 **Brick is a cross-platform 2D-compositing game engine**.
82db46c More work.
Alexander Staubo authored
4
50428ae @atombender Big refactoring.
authored
5 ## Features
82db46c More work.
Alexander Staubo authored
6
50428ae @atombender Big refactoring.
authored
7 * Written in modern C++.
8 * Platform portability layer to allow easy portability across multiple platforms.
9 * Designed to allow game logic in straight C++.
10 * Integrates with the Bullet physics engine.
82db46c More work.
Alexander Staubo authored
11
50428ae @atombender Big refactoring.
authored
12 Development is currently focused on reaching production readiness on iOS via OpenGL ES.
82db46c More work.
Alexander Staubo authored
13
50428ae @atombender Big refactoring.
authored
14 ## Dependencies
82db46c More work.
Alexander Staubo authored
15
50428ae @atombender Big refactoring.
authored
16 * [Boost](http://www.boost.org/) (1.57 or later).
17 * [libsigc++](http://libsigc.sourceforge.net/)
18 * [Bullet Collision & Detection Physics Library](http://bulletphysics.com/)
82db46c More work.
Alexander Staubo authored
19
50428ae @atombender Big refactoring.
authored
20 ## Design
82db46c More work.
Alexander Staubo authored
21
50428ae @atombender Big refactoring.
authored
22 Brick uses a variation on the model-view-controller design to enforce a strict separation between the game objects and the graphics.
82db46c More work.
Alexander Staubo authored
23
50428ae @atombender Big refactoring.
authored
24 ### World model
82db46c More work.
Alexander Staubo authored
25
50428ae @atombender Big refactoring.
authored
26 The **world model** is responsible for iterating the simulation frame by frame. It is a container of a mindless collection of objects that move only as a result of the physical laws of the universe.
82db46c More work.
Alexander Staubo authored
27
50428ae @atombender Big refactoring.
authored
28 For example, a spaceship models the behaviour of a real spaceship: it has a position and will move in space with a certain direction, velocity, etc., obeying physical laws of nature. It will also generate events when it collides with other models in the space. However, the model will never perform any actions on its own that aren't purely reactions to its environment.
82db46c More work.
Alexander Staubo authored
29
50428ae @atombender Big refactoring.
authored
30 The world model is divided into several kinds of objects:
31
32 * Physical objects such as "spaceship" and "bullet". Physical objects have position, direction, velocity, etc.
33
34 * Metaphysical objects such as "levels" and "players" that have no physical presence. These exist for storing world state as well acting as containers.
35
36 For example, a player's "lives" may be represented as metaphysical objects that are created or destroyed according to the game's progress. Metaphysical objects also act as logic gates controlling the iteration of the world.
82db46c More work.
Alexander Staubo authored
37
50428ae @atombender Big refactoring.
authored
38 ### Controllers
82db46c More work.
Alexander Staubo authored
39
50428ae @atombender Big refactoring.
authored
40 **Controllers** supply the behavioural logic that drives the simulation.
82db46c More work.
Alexander Staubo authored
41
50428ae @atombender Big refactoring.
authored
42 Controllers observe and interact with the game model through events and direct actions on the model objects. For example, a spaceship controller will control a spaceship, telling it to change direction, shoot, etc.
43
44 Controllers can also manage "intrinsic" behaviour. For example, a spaceship may have a certain amount of fuel. As long it burns fuel, it has propulsion, affecting acceleration; the model can track fuel usage and cease to accelerate once fuel is depleted.
45
46 Controllers also mediate between the game model and external input from the keyboard, the mouse, touch screen, network etc., in order to interface with the player.
82db46c More work.
Alexander Staubo authored
47
50428ae @atombender Big refactoring.
authored
48 Controllers may communicate with other controllers; for example, there might be a `PlayerController` that accepts keyboard/mouse input and which are translated into commands to the spaceship controller, which in turn controls the spaceship model.
82db46c More work.
Alexander Staubo authored
49
50428ae @atombender Big refactoring.
authored
50 ### Rendering and animators
82db46c More work.
Alexander Staubo authored
51
50428ae @atombender Big refactoring.
authored
52 **Animators** mediate between the data model and the renderer. Animators know how to translate game objects into visual, renderable objects.
82db46c More work.
Alexander Staubo authored
53
50428ae @atombender Big refactoring.
authored
54 Animators are specific to the renderer. For example, an OpenGL game will require a set of animators that know how to draw using OpenGL. Porting such a game to a different technology requires writing a new set of animators.
82db46c More work.
Alexander Staubo authored
55
50428ae @atombender Big refactoring.
authored
56 Animators typically have a 1:1 relationship with game models (and that relationship is typically pre-registered so that when a model is created, a corresponding animator is also instantiated), but this is not a requirement; for example, a particle system animator can be created that generates hundreds of visual objects that have no counterpart in the game model.
82db46c More work.
Alexander Staubo authored
57
50428ae @atombender Big refactoring.
authored
58 The **renderer** renders the game world. The renderer and the animators co-operate closely to manage the visual objects in the game. Brick currently supplies an OpenGL renderer and a bunch of animator classes to render sprites and so on.
82db46c More work.
Alexander Staubo authored
59
50428ae @atombender Big refactoring.
authored
60 ### Events
82db46c More work.
Alexander Staubo authored
61
50428ae @atombender Big refactoring.
authored
62 Forming the backbone of the world model and animation system is a simple **event system** that allows models and animators to listen to changes and react to them. For example, adding a new model object to the world will typically also create a corresponding animator.
Something went wrong with that request. Please try again.