hoa_map::private_map::ActionRandomMove Class Reference

Action for declaring random movement of sprites. More...

#include <map_actions.h>

Inheritance diagram for hoa_map::private_map::ActionRandomMove:

Inheritance graph
[legend]
Collaboration diagram for hoa_map::private_map::ActionRandomMove:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ActionRandomMove (VirtualSprite *sprite)
void Execute ()
 Executes the sprite's action.
 ~ActionRandomMove ()

Public Attributes

uint32 direction_timer
 A timer which keeps track of how long the sprite has been moving around since the last change in direction.
uint32 movement_timer
 A timer which keeps track of how long the sprite has moved about randomly.
uint32 total_direction_time
 The amount of time (in milliseconds) that the sprite should continue moving in one direction The default value for this timer is two seconds (2000ms).
uint32 total_movement_time
 The amount of time to perform random movement before ending this action Set this member to hoa_system::INFINITE_TIME in order to continue the random movement forever. The default value of this member will be set to 10 seconds if it is not specified.
MapZonezone
 A pointer to the map zone, if any, that the sprite should constrain their random movement to. TODO: has not yet been implemented.

Detailed Description

Action for declaring random movement of sprites.

****************************************************************************

This class has several parameters that can be set to define the random movement. These parameters include, for example, the amount of time to move randomly before proceeding to the sprite's next action, any temporary changes in movement speed during the random movement, whether the sprite's position should be confined to a specific map zone, etc.

Definition at line 138 of file map_actions.h.


Constructor & Destructor Documentation

hoa_map::private_map::ActionRandomMove::ActionRandomMove ( VirtualSprite sprite  )  [inline]

Definition at line 165 of file map_actions.h.

hoa_map::private_map::ActionRandomMove::~ActionRandomMove (  )  [inline]

Definition at line 168 of file map_actions.h.


Member Function Documentation

void hoa_map::private_map::ActionRandomMove::Execute (  )  [virtual]

Executes the sprite's action.

Implements hoa_map::private_map::SpriteAction.

Definition at line 91 of file map_actions.cpp.

References hoa_map::private_map::SpriteAction::_finished, hoa_map::private_map::SpriteAction::_sprite, direction_timer, hoa_system::GameSystem::GetUpdateTime(), movement_timer, hoa_map::private_map::VirtualSprite::moving, hoa_map::private_map::VirtualSprite::SetRandomDirection(), hoa_system::SystemManager, total_direction_time, and total_movement_time.

Here is the call graph for this function:


Member Data Documentation

uint32 hoa_map::private_map::ActionRandomMove::direction_timer

A timer which keeps track of how long the sprite has been moving around since the last change in direction.

Definition at line 156 of file map_actions.h.

Referenced by Execute().

uint32 hoa_map::private_map::ActionRandomMove::movement_timer

A timer which keeps track of how long the sprite has moved about randomly.

Definition at line 148 of file map_actions.h.

Referenced by Execute().

uint32 hoa_map::private_map::ActionRandomMove::total_direction_time

The amount of time (in milliseconds) that the sprite should continue moving in one direction The default value for this timer is two seconds (2000ms).

Definition at line 153 of file map_actions.h.

Referenced by Execute().

uint32 hoa_map::private_map::ActionRandomMove::total_movement_time

The amount of time to perform random movement before ending this action Set this member to hoa_system::INFINITE_TIME in order to continue the random movement forever. The default value of this member will be set to 10 seconds if it is not specified.

Definition at line 145 of file map_actions.h.

Referenced by Execute().

MapZone* hoa_map::private_map::ActionRandomMove::zone

A pointer to the map zone, if any, that the sprite should constrain their random movement to. TODO: has not yet been implemented.

Definition at line 161 of file map_actions.h.


The documentation for this class was generated from the following files:
Generated on Fri Jul 6 23:14:43 2007 for Hero of Allacrost by  doxygen 1.5.1