Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6804 in orxonox.OLD for trunk/src/world_entities/playable.cc


Ignore:
Timestamp:
Jan 28, 2006, 11:29:03 AM (20 years ago)
Author:
bensch
Message:

trunk: remastered Playables a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.cc

    r6710 r6804  
    3838  // the reference to the Current Player is NULL, because we dont have one at the beginning.
    3939  this->currentPlayer = NULL;
     40
     41  this->bFire = false;
    4042
    4143  this->setSynchronized(true);
     
    201203}
    202204
     205/**
     206 * @brief ticks a Playable
     207 * @param dt: the passed time since the last Tick
     208 */
     209void Playable::tick(float dt)
     210{
     211  this->weaponMan->tick(dt);
     212  if (this->bFire)
     213    weaponMan->fire();
     214}
     215
     216
     217/**
     218 * @brief processes Playable events.
     219 * @param event the Captured Event.
     220 */
     221void Playable::process(const Event &event)
     222{
     223  if( event.type == KeyMapper::PEV_FIRE1)
     224    this->bFire = event.bPressed;
     225  else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed)
     226  {
     227    this->nextWeaponConfig();
     228  }
     229  else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed)
     230    this->previousWeaponConfig();
     231}
     232
     233
    203234
    204235void  Playable::attachCamera()
     
    210241
    211242
     243
     244
    212245void  Playable::detachCamera()
    213246{
Note: See TracChangeset for help on using the changeset viewer.