- Timestamp:
- Oct 30, 2017, 4:04:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h
r11506 r11516 33 33 */ 34 34 35 #ifndef _DodgeRace_H__ 36 #define _DodgeRace_H__ 37 38 #include "dodgerace/DodgeRacePrereqs.h" 39 40 #include "DodgeRaceCenterPoint.h" // Necessary for WeakPointer?? 41 //#include "DodgeRaceShip.h" DO NOT include in Header. Will cause forward declaration issues 42 43 //#include "DodgeRaceHUDinfo.h" 35 #ifndef _Asteroids_H__ 36 #define _Asteroids_H__ 44 37 45 38 46 #include "core/EventIncludes.h" 47 #include "core/command/Executor.h" 48 #include "core/config/ConfigValueIncludes.h" 49 50 #include "gamestates/GSLevel.h" 51 #include "chat/ChatManager.h" 52 #include <vector> 53 54 // ! HACK 55 #include "infos/PlayerInfo.h" 56 57 #include "core/command/ConsoleCommand.h" 58 39 #include "asteroids/AsteroidsPrereqs.h" 59 40 #include "gametypes/Deathmatch.h" 60 #include "tools/Timer.h" 41 #include "worldentities/pawns/SpaceShip.h" 42 #include "weapons/projectiles/Projectile.h" 43 #include <math.h> 61 44 62 45 namespace orxonox 63 46 { 64 47 65 class _ DodgeRaceExport DodgeRace : public Deathmatch48 class _AsteroidsExport Asteroids : public SpaceShip 66 49 { 67 50 public: 68 DodgeRace(Context* context); 69 70 virtual void start() override; 71 virtual void end() override; 51 Asteroids(Context* context); 72 52 73 53 virtual void tick(float dt) override; 74 54 75 virtual void playerPreSpawn(PlayerInfo* player) override; 55 // overwrite for 2d movement 56 virtual void moveFrontBack(const Vector2& value) override; 57 virtual void moveRightLeft(const Vector2& value) override; 76 58 77 void levelUp(); 59 // Starts or stops fireing 60 virtual void boost(bool bBoost) override; 78 61 79 int getLives(){return this->lives;}80 int getLevel(){return this->level;}81 int getPoints(){return this->point;}82 int getMultiplier(){return this->multiplier;}83 62 84 63 void setCenterpoint(DodgeRaceCenterPoint* center) … … 86 65 virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command 87 66 88 // checks if multiplier should be reset.89 void comboControll();90 void costLife();91 92 67 bool bEndGame; 93 68 bool bShowLevel; 94 69 int lives; 95 int multiplier; 96 float counter; 97 int pattern; 98 float currentPosition; 99 float lastPosition; 70 float angle, radius; 71 float speed, damping, posforeward; 72 bool isFireing; 73 74 //Nachschauen wie gross das Spielfeld ist! 75 float H = 1000; 76 float W = 1000; 77 78 protected: 79 virtual void death() override; 100 80 101 81 private: 102 Timer endGameTimer; 103 104 DodgeRaceShip* getPlayer(); 105 WeakPtr<DodgeRaceShip> player; 106 std::vector<DodgeRaceCube*> cubeList; 107 void toggleShowLevel(){bShowLevel = !bShowLevel;} 108 void addPoints(int numPoints); 109 110 WeakPtr<DodgeRaceCenterPoint> center_; 111 int level; 112 int point; 113 bool b_combo; 114 115 Timer enemySpawnTimer; 116 Timer comboTimer; 117 Timer showLevelTimer; 118 119 120 /* 121 122 //void spawnEnemy(); 123 124 125 126 127 128 129 130 131 132 133 134 135 private: 136 137 138 139 140 //Context* context; 141 */ 82 Asteroids* getGame(); 83 WeakPtr<Asteroids> game; 84 WeakPtr<WorldEntity> lastEntity; 85 Camera* camera; 86 float lastTimeFront, lastTimeLeft, lastTime; 87 struct Velocity 88 { 89 float x; 90 float y; 91 } velocity, desiredVelocity; 92 142 93 }; 143 94 } 144 95 145 #endif /* _ DodgeRace_H__ */96 #endif /* _Asteroids_H__ */
Note: See TracChangeset
for help on using the changeset viewer.