- Timestamp:
- Nov 30, 2017, 6:34:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
r11608 r11613 46 46 isFireing = false; 47 47 damping = 10; 48 this->width = 1043; 49 this->height = 646; 48 50 49 51 // not sure if has to be zero? … … 51 53 lastTimeLeft = 0; 52 54 lastTime = 0; 55 timer.setTimer(3.5f, true, createExecutor(createFunctor(&Asteroids2DShip::showposition, this))); 56 } 57 58 //Use this function to display your position on the field -> to determine field width and height 59 void Asteroids2DShip::showposition() 60 { 61 Vector3 pos = this->getPosition(); 62 orxout() << "x = "<< pos.x << " y = " << pos.y << " z = "<< pos.z << endl; 53 63 } 54 64 … … 56 66 { 57 67 SUPER(Asteroids2DShip, tick, dt); 68 Vector3 pos = this->getPosition(); 69 70 //haelt ship innerhalb des Kamerafensters, kommt oben bzw seitlich wieder raus. Man spawnt in (0,0) 71 if(pos.x > width/2) pos.x = -width/2; 72 if(pos.x < -width/2) pos.x = width/2; 73 if(pos.z > height/2) pos.z = -height/2; 74 if(pos.z < -height/2) pos.z = height/2; 75 76 //2D movement, position should always = 0 on y-axis 77 if(pos.y!=0) pos.y = 0; 78 this->setPosition(pos); 79 80 //update level 81 82 //shoot? 58 83 } 59 84
Note: See TracChangeset
for help on using the changeset viewer.