Changeset 12391 for code/branches/OrxoBlox_FS19/src
- Timestamp:
- May 16, 2019, 4:57:28 PM (6 years ago)
- Location:
- code/branches/OrxoBlox_FS19/src/modules
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
r12384 r12391 332 332 } 333 333 334 void OrxoBlox::tick(float dt) 335 { 336 SUPER(OrxoBlox, tick, dt); 337 } 334 338 /* 335 339 bool OrxoBlox::Intersect(int XpositionBall, int XPositionBlock, int YPositionBall, int YPositionBlock, int radiusBall, int sizeBlock) { -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
r12371 r12391 76 76 // void spawnPlayer(PlayerInfo* Player) override; 77 77 virtual void playerPreSpawn(PlayerInfo* player) override; 78 78 virtual void tick(float dt) override; 79 79 80 80 void LevelUp(); -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc
r12370 r12391 69 69 void OrxoBloxShip::tick(float dt) 70 70 { 71 SUPER(OrxoBloxShip, tick, dt);72 71 Vector3 pos = this->getPosition(); 72 73 //ensure that the ship stays in playing field 74 if(pos.x > width/2) pos.x = -width/2; 75 if(pos.x < -width/2) pos.x = width/2; 76 if(pos.z > height/2) pos.z = -height/2; 77 if(pos.z < -height/2) pos.z = height/2; 78 79 //2D movement, position should always = 0 on y-axis 80 if(pos.y!=0) pos.y = 0; 73 81 this->setPosition(pos); 82 83 84 //if you hit an asteroid, the ship will turn -> you need to reorientate the ship 85 Quaternion ort = this->getOrientation(); 86 ort.x = 0; 87 ort.z = 0; 88 this->setOrientation(ort); 74 89 } 75 90 -
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h
r12370 r12391 53 53 //virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction. 54 54 //Yaw 55 virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction. 55 56 virtual void rotateRoll(const Vector2& value) override{}; // Rotate in roll direction. 56 57 virtual void boost(bool boost) override; //Override, so that the ship does not shake 58 57 59 58 60 /*Functions that can be helpful while debugging. … … 69 71 } 70 72 71 protected:73 //protected: 72 74 private: 73 75 OrxoBlox* getGame(); -
code/branches/OrxoBlox_FS19/src/modules/asteroids2D/Asteroids2DShip.cc
r11781 r12391 69 69 void Asteroids2DShip::tick(float dt) 70 70 { 71 SUPER(Asteroids2DShip, tick, dt);71 //SUPER(Asteroids2DShip, tick, dt); 72 72 Vector3 pos = this->getPosition(); 73 73
Note: See TracChangeset
for help on using the changeset viewer.