Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4412 in orxonox.OLD for orxonox


Ignore:
Timestamp:
May 31, 2005, 1:05:26 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: now shooting and weapon change work again

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r4410 r4412  
    426426  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
    427427  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
     428  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
     429  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
     430  this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_PREVIOUS_WEAPON);
    428431 
    429432  // bind camera
  • orxonox/trunk/src/util/event/key_mapper.cc

    r4411 r4412  
    3737int KeyMapper::PEV_FIRE1 = -1;
    3838int KeyMapper::PEV_FIRE2 = -1;
     39int KeyMapper::PEV_PREVIOUS_WEAPON = -1;
     40int KeyMapper::PEV_NEXT_WEAPON = -1;
    3941
    4042int KeyMapper::PEV_VIEW0 = -1;
     
    6466                        {&KeyMapper::PEV_FIRE1, "Fire1"},
    6567                        {&KeyMapper::PEV_FIRE2, "Fire2"},
     68                        {&KeyMapper::PEV_NEXT_WEAPON, "Next"},
     69                        {&KeyMapper::PEV_PREVIOUS_WEAPON, "Prev"},
     70
    6671
    6772                        {&KeyMapper::PEV_VIEW0, "view0"},
  • orxonox/trunk/src/util/event/key_mapper.h

    r4410 r4412  
    4949  static int PEV_FIRE1;
    5050  static int PEV_FIRE2;
     51  static int PEV_PREVIOUS_WEAPON;
     52  static int PEV_NEXT_WEAPON;
    5153
    5254  static int PEV_VIEW0;
  • orxonox/trunk/src/world_entities/player.cc

    r4409 r4412  
    234234    accel = accel+(direction*acceleration);
    235235  if( this->bDown && this->getRelCoor().x > -5)
    236     accel = accel-(direction*acceleration);
     236    accel = accel -(direction*acceleration);
    237237  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
    238238    accel = accel + (orthDirection*acceleration);
     
    300300      this->bRight = event.bPressed;
    301301    }
    302 
    303 }
     302  else if( event.type == KeyMapper::PEV_FIRE1)
     303    {
     304       this->bFire = event.bPressed;
     305    }
     306  else if( event.type == KeyMapper::PEV_NEXT_WEAPON)
     307    {
     308      if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;
     309    }
     310
     311}
Note: See TracChangeset for help on using the changeset viewer.