Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2017, 4:04:29 PM (8 years ago)
Author:
vyang
Message:

Files hinzugefuegt, versucht Aehnlichkeiten mit anderen minigames (dodgerace, invader) zu finden. Testlevel noch zu bearbeiten. Gametype Asteroids crashed immer noch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Asteroid_HS17/src/modules/asteroids/AsteroidsShip.h

    r11506 r11516  
    3333*/
    3434
    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__
    4437
    4538
    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"
    5940#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>
    6144
    6245namespace orxonox
    6346{
    6447
    65     class _DodgeRaceExport DodgeRace : public Deathmatch
     48    class _AsteroidsExport Asteroids : public SpaceShip
    6649    {
    6750       public:
    68             DodgeRace(Context* context);
    69 
    70             virtual void start() override;
    71             virtual void end() override;
     51            Asteroids(Context* context);
    7252
    7353            virtual void tick(float dt) override;
    7454
    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;
    7658
    77             void levelUp();
     59            // Starts or stops fireing
     60            virtual void boost(bool bBoost) override;
    7861
    79             int getLives(){return this->lives;}
    80             int getLevel(){return this->level;}
    81             int getPoints(){return this->point;}
    82             int getMultiplier(){return this->multiplier;}
    8362
    8463            void setCenterpoint(DodgeRaceCenterPoint* center)
     
    8665            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
    8766
    88             // checks if multiplier should be reset.
    89             void comboControll();
    90             void costLife();
    91 
    9267            bool bEndGame;
    9368            bool bShowLevel;
    9469            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;
    10080
    10181       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           
    14293    };
    14394}
    14495
    145 #endif /* _DodgeRace_H__ */
     96#endif /* _Asteroids_H__ */
Note: See TracChangeset for help on using the changeset viewer.