Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4423 in orxonox.OLD for orxonox/trunk/src/story_entities


Ignore:
Timestamp:
May 31, 2005, 7:10:01 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: space craft can be controled via keys, nothing new yet

File:
1 edited

Legend:

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

    r4422 r4423  
    601601
    602602
    603         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_UP);
    604         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_DOWN);
    605         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_LEFT);
    606         this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_RIGHT);
    607603        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_FIRE1);
    608604        this->eventHandler->subscribe(this->localPlayer, ES_GAME, KeyMapper::PEV_NEXT_WEAPON);
     
    639635
    640636        this->pilotNode = new PilotNode();
     637        this->spawn(this->pilotNode);
     638        this->pilotNode->setAbsCoor(Vector(150, -35, 5));
    641639        this->pilotNode->addChild(this->localPlayer);
    642640        this->pilotNode->addChild(this->localCamera);
    643         this->localCamera->lookAt(this->localPlayer);
    644 
     641        this->localCamera->lookAt(this->pilotNode);
     642
     643        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_UP);
     644        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_DOWN);
     645        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_LEFT);
     646        this->eventHandler->subscribe(this->pilotNode, ES_GAME, KeyMapper::PEV_RIGHT);
    645647        this->eventHandler->subscribe(this->pilotNode, ES_GAME, EV_MOUSE_MOTION);
    646648
     
    11641166  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT);
    11651167  else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP);
    1166   else if(this->pilotNode != NULL) if( !strcmp( cmd->cmd, "cursor")) this->pilotNode->command(cmd);
    11671168  return false;
    11681169}
Note: See TracChangeset for help on using the changeset viewer.