Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4409 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 31, 2005, 12:24:50 AM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: space ship control works again, now working on system commands

Location:
orxonox/trunk/src
Files:
3 edited

Legend:

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

    r4407 r4409  
    278278  this->garbageCollector = GarbageCollector::getInstance();
    279279
     280  this->eventHandler = EventHandler::getInstance();
     281
    280282  this->particleEngine = ParticleEngine::getInstance();
    281283  this->trackManager = TrackManager::getInstance();
     
    420422  orx->getLocalInput()->bind (localPlayer);
    421423
    422   EventHandler::getInstance()->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_UP);
     424  this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_UP);
     425  this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_DOWN);
     426  this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_LEFT);
     427  this->eventHandler->subscribe(this->localPlayer, ES_ALL, KeyMapper::PEV_RIGHT);
    423428 
    424429  // bind camera
  • orxonox/trunk/src/story_entities/world.h

    r4396 r4409  
    2626class TiXmlElement;
    2727class PilotNode;
     28class EventHandler;
    2829
    2930//! The game world Interface
     
    128129
    129130  GarbageCollector* garbageCollector; //!< reference to the garbage  collector
     131  EventHandler* eventHandler;
    130132
    131133  /* function for main-loop */
  • orxonox/trunk/src/world_entities/player.cc

    r4405 r4409  
    236236    accel = accel-(direction*acceleration);
    237237  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
    238     accel = accel - (orthDirection*acceleration);
     238    accel = accel + (orthDirection*acceleration);
    239239  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
    240     accel = accel + (orthDirection*acceleration);
     240    accel = accel - (orthDirection*acceleration);
    241241  if( this->bAscend )
    242242  if( this->bDescend) {/* FIXME */} /* \todo up and down player movement */
     
    284284void Player::process(const Event &event)
    285285{
    286 
    287 }
     286  if( event.type == KeyMapper::PEV_UP)
     287    {
     288      this->bUp = event.bPressed;
     289    }
     290  else if( event.type == KeyMapper::PEV_DOWN)
     291    {
     292      this->bDown = event.bPressed;
     293    }
     294  else if( event.type == KeyMapper::PEV_RIGHT)
     295    {
     296      this->bLeft = event.bPressed;
     297    }
     298  else if( event.type == KeyMapper::PEV_LEFT)
     299    {
     300      this->bRight = event.bPressed;
     301    }
     302
     303}
Note: See TracChangeset for help on using the changeset viewer.