BaseObject Class
Class org.rapo.games.BaseObject
Inheritance
>
BaseObject
Serves as a base class for all game objects.
Should be subclassed by game-specific object classes
| Constructor Summary |
|---|
| | BaseObject(x:Number, y:Number, movie_clip:MovieClip, name:String) Initializes the properties shared by all game objects. |
| Property Summary |
|---|
| Boolean | Indicates whether or not the object is alive |
| Number | The index of the objects rotation through [32] angle divisions (see MathTables) |
| Object | An Object containing x and y properties for the object's 2D game-world coordinates |
| MovieClip | The MovieClip instance associates with this object |
| String | The object's unique name |
| Number | The objects current speed (a one-dimensional, Scalar value) |
| Object | The objects current velocity (a two-dimensional, Vector value) |
| Method Summary |
|---|
| Void | Destroys (cleans up) the game object. |
| Void | Handles drwing the game object
Should be overridden in a game-specific game object class |
| Void | Draws the bounding rectangle of the game object. |
| Void | Moves the game object. |
| Void | Sets the x and y coordinates of the game object. |
| Void | Sets the rotation of the game object by setting its angleIndex
Should be overridden in a game-specific game object class |
BaseObject
public function BaseObject(x:Number, y:Number, movie_clip:MovieClip, name:String)
Initializes the properties shared by all game objects.
Parameters:
x- The object's initial x coordinate
y- The object's initial y coordinate
movie_clip- The MovieClip instance associates with this object
name- The object's unique name
alive
var alive:Boolean;
Indicates whether or not the object is alive
angleIndex
var angleIndex:Number;
The index of the objects rotation through [32] angle divisions (see MathTables)
coords
var coords:Object;
An Object containing x and y properties for the object's 2D game-world coordinates
mc
var mc:MovieClip;
The MovieClip instance associates with this object
name
var name:String;
The object's unique name
speed
var speed:Number;
The objects current speed (a one-dimensional, Scalar value)
velocity
var velocity:Object;
The objects current velocity (a two-dimensional, Vector value)
destroy
public function destroy():Void
Destroys (cleans up) the game object.
Should be overridden in a game-specific game object class
Parameters:
draw
public function draw():Void
Handles drwing the game object
Should be overridden in a game-specific game object class
Parameters:
drawBounds
public function drawBounds():Void
Draws the bounding rectangle of the game object. Useful for debugging.
Should be overridden in a game-specific game object class
Parameters:
move
public function move():Void
Moves the game object.
Should be overridden in a game-specific game object class
Parameters:
moveTo
public function moveTo(x:Number, y:Number):Void
Sets the x and y coordinates of the game object.
Should be overridden in a game-specific game object class
Parameters:
x- The new x coordinate of the game object
y- The new y coordinate of the game object
setAngleIndex
public function setAngleIndex(angle_index:Number):Void
Sets the rotation of the game object by setting its angleIndex
Should be overridden in a game-specific game object class
Parameters:
angle_index- The index of the objects rotation through [32] angle divisions (see MathTables)
Documentation generated by BLDoc Community Edition from B-Line Express.