Changeset 10128 for code/branches/surfaceraceHS14/src
- Timestamp:
- Nov 19, 2014, 4:00:53 PM (10 years ago)
- Location:
- code/branches/surfaceraceHS14/src/modules/dodgerace2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc
r10127 r10128 89 89 // shoot! 90 90 if (isFireing) 91 ControllableEntity::fire(0); 91 { 92 //pos += Vector3(900, 0, 0) * dt; 93 //ControllableEntity::fire(0); 94 } 95 92 96 93 97 // Camera … … 103 107 // bring back on track! 104 108 if(pos.y != 0) 105 pos.y = 0; 109 { 110 pos.y = 0; 111 } 106 112 107 113 setPosition(pos); … … 135 141 { 136 142 lastTimeLeft = 0; 137 desiredVelocity.x = -value.x * speed;143 desiredVelocity.x = value.x * speed; 138 144 } 139 145 void DodgeRaceShip::boost(bool bBoost) … … 141 147 isFireing = bBoost; 142 148 } 143 /* 149 144 150 inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint) 145 151 { 146 // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint; 147 WeakPtr<DodgeRaceEnemy> enemy = orxonox_cast<DodgeRaceEnemy*>(otherObject); 148 WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject); 149 // ensure that this gets only called once per enemy. 150 if (enemy != NULL && lastEnemy != enemy) 152 if (otherObject != NULL && lastEntity != otherObject) 151 153 { 152 lastEnemy = enemy; 154 lastEntity = otherObject; 155 removeHealth(20); 156 //this->death(); 157 } 153 158 154 removeHealth(20);155 if (getGame())156 {157 getGame()->multiplier = 1;158 }159 }160 // was shot, decrease multiplier161 else if (shot != NULL && lastShot != shot)162 {163 if (getGame() && orxonox_cast<DodgeRaceEnemy*>(shot->getShooter()) != NULL)164 {165 if (getGame()->multiplier > 1)166 {167 lastShot = shot;168 getGame()->multiplier -= 1;169 }170 }171 }172 159 return false; 173 // SUPER(DodgeRaceShip, collidesAgainst, otherObject, contactPoint);174 160 } 175 */ 161 176 162 WeakPtr<DodgeRace> DodgeRaceShip::getGame() 177 163 { -
code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h
r10124 r10128 79 79 80 80 private: 81 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint); 81 82 WeakPtr<DodgeRace> getGame(); 82 83 WeakPtr<DodgeRace> game; 83 84 WeakPtr<Projectile> lastShot; 85 WeakPtr<WorldEntity> lastEntity; 84 86 Camera* camera; 85 87 float lastTimeFront, lastTimeLeft, lastTime; … … 90 92 } velocity, desiredVelocity; 91 93 92 93 94 95 /*96 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);97 98 private:99 100 WeakPtr<DodgeRaceEnemy> lastEnemy;101 */102 103 94 }; 104 95 }
Note: See TracChangeset
for help on using the changeset viewer.