Changeset 1900 in orxonox.OLD for orxonox/trunk/core/orxonox.cc
- Timestamp:
- May 23, 2004, 11:21:38 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/orxonox.cc
r1899 r1900 51 51 Player* Orxonox::localPlayer = 0; 52 52 bool Orxonox::pause = false; 53 bool Orxonox::inputEnabled = false; 53 54 bool Orxonox::upWeGo = false; 54 55 bool Orxonox::downWeGo = false; … … 87 88 88 89 glutTimerFunc(1000, timeSlice, 0); 90 cout << "measuring performance..."; 89 91 } 90 92 … … 114 116 world->addNPC(npc); 115 117 118 NPC* npc2 = new NPC; 119 npc2->setPosition(-2.0, 10.0, 3.0); 120 npc2->setCollisionRadius(1.0); 121 world->addNPC(npc2); 122 116 123 glutSpecialFunc(specFunc); 117 124 glutSpecialUpFunc(releaseKey); … … 126 133 void Orxonox::timeSlice(int value) 127 134 { 128 cout << "fps: " << fps << endl; 135 cout << "got " << fps << endl; 136 /* this is very very unsafe: io could be uninit */ 137 io->setPlayerStep(19.2 / fps); /* set player to propper speed */ 138 //localPlayer->shootLaser->setShootStep(fps/48.0); /* set shoot speed */ 129 139 fps = 0; 140 inputEnabled = true; 130 141 glutTimerFunc(1000, timeSlice, 0); 131 142 } … … 259 270 260 271 /* check for input to pass it over */ 261 if ( !pause && (rightWeGo || leftWeGo || upWeGo || downWeGo || shoot1)) { 262 if (upWeGo) 263 (*io).goUp(); 264 if (downWeGo) 272 if ( !pause && inputEnabled && 273 (rightWeGo || leftWeGo || upWeGo || downWeGo || shoot1)) 274 { 275 if (upWeGo) 276 (*io).goUp(); 277 if (downWeGo) 265 278 (*io).goDown(); 266 if (rightWeGo)267 268 if (leftWeGo)279 if (rightWeGo) 280 (*io).goRight(); 281 if (leftWeGo) 269 282 (*io).goLeft(); 270 if (shoot1)271 272 }283 if (shoot1) 284 (*io).shoot(); 285 } 273 286 /* request repaint */ 274 287 glutPostRedisplay();
Note: See TracChangeset
for help on using the changeset viewer.