Game Development Reference
In-Depth Information
package com.flashgamebook.engines.platformer.sprites {
public interface IItem extends ISprite {
function get points():Number;
function set points(value:Number):void;
function get type():String;
function set type(value:String):void;
function pickUp():void;
}
}
The IPortal Interface
As I mentioned earlier in the chapter, portals are the devices that
players use to move between levels.
package com.flashgamebook.engines.platformer.sprites {
public interface IPortal extends ISprite {
function get requirements():Array;
function set requirements(value:Array):void;
function get destination():String;
function set destination(value:String):void;
}
}
The IWall Interface
The final interface, and the only one that doesn
textendfrom
something else, is the one used for instances of walls. Although all
of these functions are defined in ISprite, IWall intentionally has a
smaller subset to keep it separate from that hierarchy. Collision
detection with walls is handled differently than with other objects,
so this gives us an opportunity to expand this interface without
ramifications to other parts of the engine.
'
package com.flashgamebook.engines.platformer.sprites {
import flash.display.DisplayObject;
import flash.geom.Rectangle;
public interface IWall {
//DISPLAY OBJECT PROPERTIES AND METHODS
function get x():Number;
Search Nedrilad ::




Custom Search