GODPAPER | All Packages | All Classes | Index | Frames No Frames |
Vehicle

Package | com.lookbackon.AI.steeringBehavior
Class | public class Vehicle
Inheritance | Vehicle flash.display.Sprite
Subclasses | SteeredVehicle

Base class for moving characters.

Public Properties

| Property | Defined By
--- | --- | ---
|  | edgeBehavior : String Sets / gets what will happen if character hits edge. | Vehicle
|  | mass : Number Sets / gets mass of character. | Vehicle
|  | maxSpeed : Number Sets / gets maximum speed of character. | Vehicle
|  | position : Vector2D Sets / gets position of character as a Vector2D. | Vehicle
|  | velocity : Vector2D Sets / gets velocity of character as a Vector2D. | Vehicle
|  | x : Number [override] [write-only] Sets x position of character. | Vehicle
|  | y : Number [override] [write-only] Sets y position of character. | Vehicle

Protected Properties

| Property | Defined By
--- | --- | ---
|  | _edgeBehavior : String = wrap | Vehicle
|  | _mass : Number = 1.0 | Vehicle
|  | _maxSpeed : Number = 10 | Vehicle
|  | _position : Vector2D | Vehicle
|  | _velocity : Vector2D | Vehicle

Public Methods

| Method | Defined By
--- | --- | ---
|  | Vehicle() Constructor. | Vehicle
|  | update():void Handles all basic motion. | Vehicle

Protected Methods

| Method | Defined By
--- | --- | ---
|  | draw():void Default graphics for vehicle. | Vehicle

Public Constants

| Constant | Defined By
--- | --- | ---
|  | BOUNCE : String = bounce [static] | Vehicle
|  | WRAP : String = wrap [static] | Vehicle

Property Detail

_edgeBehavior | property

`protected var _edgeBehavior:String = wrap`

_mass | property |

`protected var _mass:Number = 1.0`

_maxSpeed | property |

`protected var _maxSpeed:Number = 10`

_position | property |

`protected var _position:Vector2D`

_velocity | property |

`protected var _velocity:Vector2D`

edgeBehavior | property |

`edgeBehavior:String`

Sets / gets what will happen if character hits edge.

Implementation
`public function get edgeBehavior():String`
`public function set edgeBehavior(value:String):void`

mass | property |

`mass:Number`

Sets / gets mass of character.

Implementation
`public function get mass():Number`
`public function set mass(value:Number):void`

maxSpeed | property |

`maxSpeed:Number`

Sets / gets maximum speed of character.

Implementation
`public function get maxSpeed():Number`
`public function set maxSpeed(value:Number):void`

position | property |

`position:Vector2D`

Sets / gets position of character as a Vector2D.

Implementation
`public function get position():Vector2D`
`public function set position(value:Vector2D):void`

velocity | property |

`velocity:Vector2D`

Sets / gets velocity of character as a Vector2D.

Implementation
`public function get velocity():Vector2D`
`public function set velocity(value:Vector2D):void`

x | property |

`x:Number` [write-only] [override]

Sets x position of character. Overrides Sprite.x to set internal Vector2D position as well.

Implementation
`public function set x(value:Number):void`

y | property |

`y:Number` [write-only] [override]

Sets y position of character. Overrides Sprite.y to set internal Vector2D position as well.

Implementation
`public function set y(value:Number):void`
Constructor Detail

Vehicle | () | Constructor

`public function Vehicle()`

Constructor.

Method Detail

draw | () | method

`protected function draw():void`

Default graphics for vehicle. Can be overridden in subclasses.

update | () | method |

`public function update():void`

Handles all basic motion. Should be called on each frame / timer interval.

Constant Detail

BOUNCE | Constant

`public static const BOUNCE:String = bounce`

WRAP | Constant |

`public static const WRAP:String = wrap`

Thu Jan 16 2014, 01:11 PM +08:00