Obstacle class

Class allows run time obstacles to be placed in a game. Also includes a callback when an obstacle is hit by a player Allows a player to be stopped without relying on walls defined in terrain model

Constructors

Obstacle(dynamic x, dynamic y, dynamic width, dynamic height, {dynamic level = 0, dynamic marker, dynamic callback, dynamic callbacknextwait})
Set the position of the obstacle at x,y and level with a width and height. If obstacle hit call callback callbacknextwait is a how long must wait in seconds before a callback is called again - stops flood of callbacks if player keeps hitting an obstacle marker is the scene (or hotload) so can place a marker on the scene showing the position of the marker

Properties

callback ↔ Function?
getter/setter pair
callbacknexttick ↔ int
getter/setter pair
callbacknextwait ↔ double
getter/setter pair
enabled ↔ bool
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
height ↔ double
getter/setter pair
level ↔ int
getter/setter pair
marker ↔ Object3D?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width ↔ double
getter/setter pair
x ↔ double
getter/setter pair
y ↔ double
getter/setter pair

Methods

executeCallback() → dynamic
Execute the callback but only if sufficent time has past from the previous callback
hitDirection(dynamic posx, dynamic posy) → int
Returns the closest point on or inside the obstacle to (posx, posy). Calculates which side the point posx,posy hits and returns standard headings: North (0), East (90), South (180), West (270)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited