Changeset 11643 for code/branches/Asteroid_HS17/src/modules/asteroids2D
- Timestamp:
- Dec 7, 2017, 6:25:56 PM (7 years ago)
- Location:
- code/branches/Asteroid_HS17/src/modules/asteroids2D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.cc
r11637 r11643 97 97 inline bool Asteroids2DShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 98 98 { 99 removeHealth(100); 100 getGame()->addPoints(10); 99 100 orxout() << "touched" << endl; 101 Asteroids2DStone* stone = orxonox_cast<Asteroids2DStone*>(otherObject); 102 if(stone != nullptr && (stone != lastStone || lastStone == nullptr)) 103 { 104 removeHealth(100); 105 lastStone = stone; 106 107 } 101 108 return false; 102 109 } -
code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DShip.h
r11637 r11643 38 38 #include "asteroids2D/Asteroids2DPrereqs.h" 39 39 40 40 41 #include "core/XMLPort.h" 41 42 #include "worldentities/pawns/SpaceShip.h" 43 #include "weapons/WeaponsPrereqs.h" 42 44 #include "graphics/Camera.h" 43 45 44 46 #include "Asteroids2D.h" // Is necessary for getGame function 45 47 //#include "Asteroids2DCenterPoint.h" 48 #include "Asteroids2DStone.h" 46 49 47 50 #include "tools/Timer.h" … … 80 83 private: 81 84 Asteroids2D* getGame(); 85 82 86 float width, height; 83 87 WeakPtr<Asteroids2D> game; 84 WeakPtr<WorldEntity> lastEntity; 85 struct Velocity 86 { 87 float x; 88 float y; 89 } velocity, desiredVelocity; 88 WeakPtr<Asteroids2DStone> lastStone; 90 89 91 90 Timer timer;
Note: See TracChangeset
for help on using the changeset viewer.