Game Development Reference
In-Depth Information
from the level. If nothing is missing, the error is null and will be
ignored by the engine.
public function get startPoint():Point
{
return _startPoint;
}
public function get endPoint():Point
{
return _endPoint;
}
public function get hazards():Vector. < IHazard >
{
return _hazards;
}
public function get walls():Vector.
<
IWall
>
{
return _walls;
}
Finally, every level provides read-only accessors for each of its
private member variables. These were used in multiple places by the
engine, particularly with respect to collision detection. Since we
'
re
already on the topic, we
ll also take a quick look in the XFL file at
how a level is composed. If you opened the Game folder in the
library and selected the symbol named Level 1, and then opened its
properties panel, you would see as that in Fig. 15.8 . The base class is
listed as the file we just looked at, and the symbol class name is sim-
ply
'
ll see
that they are simply markers for the starting and end points. All of
the blue walls are made up of one symbol in the library whose class
we
Level1.
If you select the two black dots in the level, you
'
'
ll look at shortly.
IBall, IHazard, IWall
These three interfaces are all very simple, so we
'
ll look at them
altogether in one pass.
public interface IBall extends IEventDispatcher
{
function get x():Number;
function set x(value:Number):void;
function get y():Number;
function set y(value:Number):void;
function get width():Number;
function set width(value:Number):void;
Search Nedrilad ::




Custom Search