Game Development Reference
In-Depth Information
public var portals:Vector. < IPortal > = new Vector.
< IPortal > ();
public function hasEnemy(sprite:IEnemy):Boolean {
return (enemies.indexOf(sprite) > -1);
}
public function removeEnemy(sprite:IEnemy):void {
if (enemies.indexOf(sprite) > -1) {
enemies.splice(enemies.indexOf
(sprite),1);
}
}
public function hasItem(sprite:IItem):Boolean {
return (items.indexOf(sprite)
>
-1);
}
public function removeItem(sprite:IItem):void {
if (items.indexOf(sprite)
-1) {
items.splice(items.indexOf
(sprite),1);
>
}
}
public function concat(gridReference:
GridReference): void {
if (!gridReference) return;
walls = walls.concat(gridReference.walls);
items = items.concat(gridReference.items);
enemies = enemies.concat(gridReference.enemies);
portals = portals.concat(gridReference.portals);
}
public function toString():String {
var str:String = " GRID REFERENCE:\n " ;
str += " WALLS: " + walls + " \n " ;
str +=
"
ITEMS:
"
+ items +
"
\n
"
;
str +=
"
ENEMIES:
"
+ enemies +
"
\n
"
;
str +=
"
PORTALS:
"
+ portals;
return str;
}
public function clear():void {
walls = null;
items = null;
enemies = null;
Search Nedrilad ::




Custom Search