Changeset 1896 in orxonox.OLD for orxonox/trunk/core/orxonox.cc
- Timestamp:
- May 20, 2004, 1:01:57 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/core/orxonox.cc
r1883 r1896 26 26 /* class definition header */ 27 27 #include "orxonox.h" 28 #include "environment.h"29 28 30 29 … … 50 49 World* Orxonox::world = 0; 51 50 InputOutput* Orxonox::io = 0; 51 Player* Orxonox::localPlayer = 0; 52 52 bool Orxonox::pause = false; 53 53 bool Orxonox::upWeGo = false; … … 55 55 bool Orxonox::rightWeGo = false; 56 56 bool Orxonox::leftWeGo = false; 57 bool Orxonox::shoot1 = false; 57 58 int Orxonox::alpha = 0; 58 59 int Orxonox::beta = 0; … … 82 83 glutReshapeFunc(reshape); 83 84 glutKeyboardFunc(keyboard); 85 glutKeyboardUpFunc(upKeyboard); 84 86 } 85 87 … … 96 98 world = new World; 97 99 (*world).initEnvironement(); 98 Player*localPlayer = new Player;100 localPlayer = new Player; 99 101 io = new InputOutput(world, localPlayer); 100 102 (*world).addPlayer(localPlayer); 101 103 Environment *env = new Environment; 102 104 (*world).addEnv(env); 103 104 105 105 106 glutSpecialFunc(specFunc); 106 107 glutSpecialUpFunc(releaseKey); 107 108 108 //for testing purps only109 //testTheShit();110 109 glutIdleFunc(continousRedraw); 110 //cout << "Orxonox::gameInit" << endl; 111 111 } 112 112 … … 131 131 132 132 /* game controls */ 133 134 133 case 'p': 135 134 if (pause) … … 146 145 } 147 146 break; 147 case 32: 148 shoot1 = true; 149 break; 148 150 case 27: 149 151 case 'q': … … 154 156 155 157 158 void Orxonox::upKeyboard(unsigned char key, int x, int y) 159 { 160 switch(key) { 161 case 32: 162 shoot1 = false; 163 break; 164 } 165 } 166 167 156 168 void Orxonox::quitGame() 157 169 { 158 //glutIgnoreKeyRepeat(0); /* for win32 */ 159 //glutSetKeyRepeat(GLUT_KEY_REPEAT_DEFAULT); /*do not remove or you will have 160 // no repeating keys anymore...*/ 161 cout << "finished garbage colletion, quitting..." << endl; 170 //cout << "finished garbage colletion, quitting..." << endl; 162 171 exit(0); 163 172 } … … 191 200 { 192 201 switch(key) { 193 194 202 /* spacecraft controls */ 195 196 203 case GLUT_KEY_UP: 197 204 upWeGo = true; … … 226 233 { 227 234 /* check for input to pass it over */ 228 if ( !pause && (rightWeGo || leftWeGo || upWeGo || downWeGo )) {235 if ( !pause && (rightWeGo || leftWeGo || upWeGo || downWeGo || shoot1)) { 229 236 if (upWeGo) 230 237 (*io).goUp(); … … 235 242 if (leftWeGo) 236 243 (*io).goLeft(); 244 if (shoot1) 245 (*io).shoot(); 237 246 } 238 247 /* request repaint */ 239 240 //cout << "contiousRedraw" << endl;241 248 glutPostRedisplay(); 249 //cout << "Orxonox::continousRedraw" << endl; 242 250 } 243 251 … … 248 256 glMatrixMode(GL_PROJECTION); 249 257 glLoadIdentity(); 250 //glOrtho(-50.0, 50.0, -50.0, 50.0, -1.0, 1.0); pb: //simple and working251 258 glFrustum(-1.0, 1.0, -1.0, 1.0, 1.5, 200.0); 252 //glFrustum(-10.0, 10.0, -5.0, 10.0, 0.0, 100.0);253 259 glMatrixMode(GL_MODELVIEW); 254 260 glLoadIdentity(); //pb why a second time?
Note: See TracChangeset
for help on using the changeset viewer.