In order to facilitate easier explanation of the workings of Booty its essential to give an overview of various concepts that Booty5 utilises.
The Canvas is the HTML5 canvas that Booty5 targets for rendering. Currently the Booty5 game engine targets HTML5 canvas only (no WebGL). Future versions of the Booty5 game maker will offer support for other game engines such as Phaser and Cocos2d-js
App, Scenes & Actors
Booty5 uses an hierarchical tree based scene graph to organise, update and display game objects.
The App is the top level container object that is responsible for keeping the game logic up to date, drawing objects to the canvas, monitoring device input, running and rendering scenes etc..
Scenes are containers for actors and are used to separate app functionality into parts. For example, your game could use a scene for each game level that it contains, as well as additional scenes for game HUD overlays, a main menu screen and so on. You can think of a Scene as a game level wide container
Actors represent the individual game objects that make up your game, for example a sprite based actor may represent the main game character, whilst other sprite based actors represent the baddies and the bullets etc.. Like scenes, actors also contain their own hierarchical tree, which can be used to manage sub actors.
When exporting your game from the game editor the canvas and app is automatically created for you. You can create scenes and actors from code or more intuitively using the game editor.
Animation is a huge part of Booty5 because animation is such a large part of making games. Booty5 supports animation in different ways including:
- Timelines – A timeline is a collection of animation key frames for the various properties of objects such as position, scale and rotation that change over time
- Bitmap animation – Using image atlases the bitmap that represents a game object can be changed to show frame by frame animation
- Physics – Using arcade style physics or full on physics simulation using Box2D, objects can be set up to travel / rotate and interact with the environment
You can create animations either in code or in the game editor. The game editor supports a Flash style timeline animation system based on key frames and tweening.
Action lists offer a way of adding game logic to scenes and actors using bolt together building block style actions. An action is a piece of functionality that can be added to an object to modify and extend its behaviour. An actions list is a collection of such actions that are executed sequentially / concurrently. Action lists can be added in code or in the game editor. The game editor supports the creation of action lists using human readable action commands, making it easy for none programmers to modify game object behaviour.
Many of the objects defined in the Booty5 game engine use event handlers to react to the numerous events that can take place during a game. For example the main App responds to touch / mouse / keyboard input using events and game objects respond to being updated, touched, collided with etc.. Each event can have an event handler associated with it which will respond to the event taking place. For example, you may attach an OnTick event handler to an actor which will do something with the actor every time the actors logic loop is updated.
The Booty5 game editor makes responding to events very easy by exposing all available events for an object and allowing you to define what happens in response.
Booty5 supports a multitude of different types of resources from sounds and bitmaps to shapes and brushes. Resources can have local or global scope, resources that are global are accessible to all scenes and objects within the game and will remain in memory until the game is shut down or manually removed. Local resources are local to the scene that contains them and are generally only accessible to the scene and the actors that it contains. When a scene is loaded all of its local resources will be loaded, when a scene is destroyed all of its resources will also be destroyed. This type of resource management system is useful when dealing with games that run on resource constrained devices such as mobile phones.
Note that two resources of the same type should not share the same name within the same scene.
All Booty5 engine classes / code are placed within the b5 namespace. For example a Scene is accessed via b5.Scene instead of Scene, for example:
var scene = new b5.Scene();
5,010 total views, 4 views today