Monday, August 15, 2011

PushButtonEngine mini-reference

I have plans, always plans, to churn out some apps for the iPad. Some of those are conversions of the old 8-bit games I wrote for the Commodore 64 for my own geeky pleasure. In those cases, I want to use what I already know -- ActionScript development -- with a bit of help; that is, PushButtonEngine.

So this, a very brief, very basic component reference for me.  And an order:

(1) allocate the entity
(1a) make sure the "layerIndex" is correct... lower = further in the background
(2) create the spatial component
(3) create the sprite component
(4) create the controller component, pointing to the spatial comp.

ref: http://blog.flashgen.com/gaming/pushbutton-engine/pushbutton-engine-working-with-bitmap-sprites/




SimpleSpatialComponent - sets size and position of the Entity. 
SimpleShapeRenderer - assigns a basic shape (circle, square) to the Entity. 
Tends to "bind" to the Entity's size, position, rotation.
 
SpriteRenderer - what we actually use to represent an Entity. 
 
TickedComponent - gets called at each game tick. 
Used for controlling an Entity by listening to input, for example.
 
A flexible way to handle input is to map them to handlers.
 
public class InputMapKeyboardController extends TickedComponent
{...}
 
ref: http://blog.flashgen.com/gaming/pushbutton-engine/pushbutton-engine-handling-user-input/