Game Development Reference
In-Depth Information
bmd.width,
bmd.height,
7, 7);
graphics.endFill();
HEIGHT = bmd.height;
}
public function get color():int {
return m_color;
}
public function set step(step:int):void {
m_step = step;
var p:Point;
p = Map.spotPos[m_step] as Point;
x = p.x;
}
public function get step():int {
return m_step;
}
public function set pos(pos:int):void {
m_pos = pos;
var p:Point;
p = Map.spotPos[step] as Point;
y = p.y - ((HEIGHT-10)*m_pos) ;
}
public function get pos():int {
return m_pos;
}
}
Card management
The game consists of 35 cards. Each card in the game is implemented as the
Card
class. Each card has a unique ID (
m_id
) value. The color (
m_color
) determines the
frog it affects;
m_value
is the number of steps the frog will move, either -1, +1, or
+2. Each card also listens to the mouse events, specifically
MOUSE_OVER,
where we
make card appear bigger and
MOUSE_OUT
where we resize it back to normal. The
MouseClick
is where we pass clicked on card to the manager. The mouse click
means the player wants to play this card or discard it.
Here is the full listing of the class
Card
:
package jjf.game
{