Blaze Brigade
Static Public Member Functions | List of all members
View.Animation Class Reference

Static class containing all animation methods More...

Static Public Member Functions

static void attackAnimation (Direction direction, Unit unit)
 
static void animateUnitPosition (Graph graph, Unit unit, Node node)
 
static void animate (Direction direction, Unit unit)
 

Detailed Description

Static class containing all animation methods

Member Function Documentation

§ animate()

static void View.Animation.animate ( Direction  direction,
Unit  unit 
)
static

Animate sprite to "walk" in the specified direction. This is done by cycling through 3 frames. For each direction, there is a frame with right foot forward, one with both at neutral, and one with left forward. The "walking" animation is done by cycling through the 3 frames.

Parameters
directionThe direction the unit is moving in

§ animateUnitPosition()

static void View.Animation.animateUnitPosition ( Graph  graph,
Unit  unit,
Node  node 
)
static

Animates unit movement from current unit location to future unit location. Unit moves through the inbetween nodes obtained from pathing algorith by first moving horizontally, then vertically. For horizontally, the unit will move right if the future position is greater in the x direction, otherwise it will move left. For vertical, the unit will move down if future y position is greater then current, otherwise it will move up. animate is called to animate the walking from node to node, and the direction parameter in that call is determined by which direction the unit is moving.

Parameters
graphGraph of the map.
unitUnit to be animated.
nodeNode to move to.

§ attackAnimation()

static void View.Animation.attackAnimation ( Direction  direction,
Unit  unit 
)
static

Animates attack of unit in specified direction. The animation consists of moving 10 pixels towards that direction, then moving back to original location. Upon execution, gameState isAnimating is set to true, and false after it is finished.

Parameters
directionThe direction of the attack - can be Up, Down, Left, or Right
unitUnit to be animated.

The documentation for this class was generated from the following file: