FROG

FROG Recognizer of Gestures

UFOSprite Class Reference

Represents a single UFO in the DemoGame. More...

Inheritance diagram for UFOSprite:
Collaboration diagram for UFOSprite:

List of all members.

Public Member Functions

 UFOSprite (DemoGame game, int type)
 Constructs a new UFOSprite.
void draw (Graphics g)
 Draws this sprite to the given Graphics context.
boolean equals (Object other)
void giveTarget (CowSprite cow)
 Gives a new target CowSprite for the UFO to approach.
int kill ()
 Disables this sprite's draw method.
void setKillColor (Color color)
void update ()
 Causes this sprite update its current state.

Public Attributes

final int type
 Type of gesture shown on this UFO.

Static Public Attributes

static final int UFO_SCORE = 100
 Points killing a UFO is worth.
static final float SPEEDX = 0.0035f
 UFO movement speed.
static final float SPEEDY = 0.005f
static final float HOVER_HEIGHT = 0.1f
 Height at which the UFO will hover over a cow target.
static final int ABDUCTION_TIME
 The amount of time it takes for a cow to be abducted given HOVER_HEIGHT and CowSprite#ABDUCT_SPEED.
static final int EXPLODING_TIME = 30
 Frames for UFO exploding.

Detailed Description

Represents a single UFO in the DemoGame.

A UFOSprite is responsible for a UFO's behavior which includes swooping in from the top of the screen, moving towards a CowSprite. If it abducts a CowSprite, it heads back to the top of the screen and disappears.

UFOSprites are responsible for keeping track of a UFO's sounds, images, and states. UFOSprites come in five different types: circle, triangle, square, X, and Z. UFOSprites can be destroyed by a Player making a matching gesture and will reward that Player with 100 points.

Author:
Team Better Recognize

Constructor & Destructor Documentation

UFOSprite ( DemoGame  game,
int  type 
)

Constructs a new UFOSprite.

Parameters:
game the DemoGame this UFOSprite is a part of.
type the gesture type of this UFO.

Member Function Documentation

void draw ( Graphics  g  ) 

Draws this sprite to the given Graphics context.

Parameters:
g the Graphics context this sprite should draw itself to.

Implements Sprite.

Here is the call graph for this function:

boolean equals ( Object  other  ) 
void giveTarget ( CowSprite  cow  ) 

Gives a new target CowSprite for the UFO to approach.

Parameters:
cow a CowSprite to chase after.

Here is the call graph for this function:

Here is the caller graph for this function:

int kill (  ) 

Disables this sprite's draw method.

Performs any necessary clean up and displays any effects that need to appear upon this object's death. Some sprites may be worth points when they are killed. If this is the case, kill will return those points as an integer.

Returns:
number of points this sprite is worth, if any.

Implements Sprite.

Here is the call graph for this function:

void setKillColor ( Color  color  ) 
void update (  ) 

Causes this sprite update its current state.

This may be moving by one step or adjusting it's current display picture.

Implements Sprite.

Here is the call graph for this function:


Member Data Documentation

final int ABDUCTION_TIME [static]
Initial value:
 
      (int) (HOVER_HEIGHT / CowSprite.ABDUCT_SPEED)

The amount of time it takes for a cow to be abducted given HOVER_HEIGHT and CowSprite#ABDUCT_SPEED.

final int EXPLODING_TIME = 30 [static]

Frames for UFO exploding.

final float HOVER_HEIGHT = 0.1f [static]

Height at which the UFO will hover over a cow target.

final float SPEEDX = 0.0035f [static]

UFO movement speed.

final float SPEEDY = 0.005f [static]
final int type

Type of gesture shown on this UFO.

final int UFO_SCORE = 100 [static]

Points killing a UFO is worth.


The documentation for this class was generated from the following file:
  • /Users/dev/Documents/SVN brazos.cs.tcu.edu/trunk/FROG/src/frog/demo/UFOSprite.java
 All Classes Namespaces Files Functions Variables