Game Development Reference
In-Depth Information
The m_color determines which color the frog represents. The color constants are
defined in the Color class:
package jjf.game
{
public class Color
{
public static const BLUE:int = 10;
public static const GREEN:int = 20;
public static const RED:int = 30;
public static const PURPLE:int = 40;
public static const YELLOW:int = 50;
public function Color()
{
}
}
}
The following is the complete listing of the Frog class:
package jjf.game
{
import flash.display.BitmapData;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.geom.Point;
public class Frog extends Sprite
{
private static var HEIGHT:int;
private var m_color:int;
// determines where this
// frog is on the track
private var m_step:int;
// 0 is the bottom most
private var m_pos:int;
public function Frog(color:int,
map:Map,
bmd:BitmapData)
{
super();
m_color = color;
graphics.beginBitmapFill(bmd);
graphics.drawRoundRect(0, 0,
 
Search WWH ::




Custom Search