[Orxonox-commit 6507] r11151 - in code/branches/tgidronFS16: data/levels/templates data/overlays src/modules/hover

tgidron at orxonox.net tgidron at orxonox.net
Thu Mar 24 15:53:28 CET 2016


Author: tgidron
Date: 2016-03-24 15:53:28 +0100 (Thu, 24 Mar 2016)
New Revision: 11151

Modified:
   code/branches/tgidronFS16/data/levels/templates/spaceshipHover.oxt
   code/branches/tgidronFS16/data/overlays/HoverHUD.oxo
   code/branches/tgidronFS16/src/modules/hover/FlagHUD.cc
   code/branches/tgidronFS16/src/modules/hover/Hover.cc
   code/branches/tgidronFS16/src/modules/hover/Hover.h
   code/branches/tgidronFS16/src/modules/hover/HoverShip.cc
Log:
New Level Up

Modified: code/branches/tgidronFS16/data/levels/templates/spaceshipHover.oxt
===================================================================
--- code/branches/tgidronFS16/data/levels/templates/spaceshipHover.oxt	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/data/levels/templates/spaceshipHover.oxt	2016-03-24 14:53:28 UTC (rev 11151)
@@ -17,9 +17,9 @@
    reloadrate          = 2
    reloadwaittime      = 0.5
 
-   primaryThrust     = 200
-   auxilaryThrust    = 30
-   rotationThrust    = 25
+   primaryThrust     = 100
+   auxilaryThrust    = 1
+   rotationThrust    = 30
 
    jumpBoost = 90
 
@@ -32,7 +32,7 @@
    boostCooldownDuration = 10
 
    collisionType     = "dynamic"
-   mass              = 100
+   mass              = 1000
    linearDamping     = 0.2
    angularDamping    = 0.9999999
   >
@@ -78,14 +78,14 @@
   <MultiStateEngine
    boostfactor    = 2
 
-   speedfront     = 90
+   speedfront     = 120
    speedback      =  40
    speedleftright =  40
    speedupdown    =  40
 
    accelerationfront     = 500
    accelerationbrake     = 500
-   accelerationback      =  125
+   accelerationback      =  250
    accelerationleftright =  125
    accelerationupdown    =  125
   >

Modified: code/branches/tgidronFS16/data/overlays/HoverHUD.oxo
===================================================================
--- code/branches/tgidronFS16/data/overlays/HoverHUD.oxo	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/data/overlays/HoverHUD.oxo	2016-03-24 14:53:28 UTC (rev 11151)
@@ -38,9 +38,21 @@
      correctaspect     = true
      iconmaterial      = "Orxonox/BarIconHealth"
     >
+
       <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
       <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
       <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
     </HUDHealthBar>
+
+
+    <HUDNavigation
+     name          = "Navigation"
+     correctaspect = true
+     font          = "Monofur"
+     textsize      = 0.02
+     navMarkerSize = 0.03
+     aimMarkerSize = 0.02
+    />
+
  </OverlayGroup>
 </Template>

Modified: code/branches/tgidronFS16/src/modules/hover/FlagHUD.cc
===================================================================
--- code/branches/tgidronFS16/src/modules/hover/FlagHUD.cc	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/src/modules/hover/FlagHUD.cc	2016-03-24 14:53:28 UTC (rev 11151)
@@ -53,8 +53,8 @@
         this->panel_->setMaterialName("Hover/Flag");
         this->overlay_->add2D(this->panel_);
 
-        this->flagCount_ = 5;
-        setFlagCount(5);
+        this->flagCount_ = 1;
+        setFlagCount(1);
     }
 
     FlagHUD::~FlagHUD()

Modified: code/branches/tgidronFS16/src/modules/hover/Hover.cc
===================================================================
--- code/branches/tgidronFS16/src/modules/hover/Hover.cc	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/src/modules/hover/Hover.cc	2016-03-24 14:53:28 UTC (rev 11151)
@@ -32,12 +32,13 @@
 */
 
 #include "Hover.h"
-
+#include "chat/ChatManager.h"
 #include "HoverOrigin.h"
 #include "HoverWall.h"
 #include "HoverFlag.h"
 #include "MazeGenerator.h"
 #include "core/CoreIncludes.h"
+#include "gamestates/GSLevel.h"
 
 namespace orxonox
 {
@@ -50,21 +51,28 @@
         this->origin_ = nullptr;
         this->numberOfFlags_ = 1;
         this->firstTick_ = true;
+        level = 1; //start at level 1
+        flagsTaken = 0;// took 0 flags in the beginning
 
+        numCells = 0;
+        cellSize = 0;
+        cellHeight = 0;
+
         this->setHUDTemplate("HoverHUD");
+
+        
     }
 
-    void Hover::tick(float dt)
+    void Hover::start()
     {
-        SUPER(Hover, tick, dt);
-
+        Gametype::start();
         if(this->firstTick_ && this->origin_)
         {
             this->firstTick_ = false;
 
-            int numCells = this->origin_->getNumCells();
-            int cellSize = this->origin_->getCellSize();
-            int cellHeight = this->origin_->getCellHeight();
+            numCells = this->origin_->getNumCells();
+            cellSize = this->origin_->getCellSize();
+            cellHeight = this->origin_->getCellHeight();
 
             MazeGenerator generator(numCells);
             generator.generateMaze();
@@ -93,23 +101,56 @@
                 }   
             }
 
-            //Generate 5 flags randomly
-            for ( int i = 0; i < 5; i++ )
+            //Generate 5 flags randomly (test only 1 flag)
+            for ( int i = 0; i < 1; i++ )
             {
                 HoverFlag* flag = new HoverFlag(origin_->getContext());
                 flag->init(rand()%numCells, rand()%numCells, cellSize);
                 flags_.push_back(flag);
             }
 
-        }//firsttick end
+        } 
+    }
 
+
+
+    void Hover::startLevel(){
+        //Generate 5 flags randomly (test only 1 flag)
+            for ( int i = 0; i < 1; i++ )
+            {
+                HoverFlag* flag = new HoverFlag(origin_->getContext());
+                flag->init(rand()%numCells, rand()%numCells, cellSize);
+                flags_.push_back(flag);
+            }
+
+    }
+
+    void Hover::tick(float dt)
+    {
+        SUPER(Hover, tick, dt);
+
+
         // Check if ship collided with one of the flags
         for ( unsigned int i = 0; i < flags_.size(); i++ ){
             if(flags_[i]->getCollided()){
                 flags_[i]->destroyLater();
                 flags_.erase (flags_.begin()+i);
+                if(flags_.size()<=0){
+                    ChatManager::message("Level Up!");
+                    
+                    levelUp();
+                    //GSLevel::startMainMenu();
+                }
             }
+
         }
         numberOfFlags_ = flags_.size();
     }
+
+    void Hover::levelUp()
+    {
+        level++;
+        startLevel();
+
+    }
 }

Modified: code/branches/tgidronFS16/src/modules/hover/Hover.h
===================================================================
--- code/branches/tgidronFS16/src/modules/hover/Hover.h	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/src/modules/hover/Hover.h	2016-03-24 14:53:28 UTC (rev 11151)
@@ -54,6 +54,12 @@
             void setOrigin(HoverOrigin* origin)
                 { this->origin_ = origin; }
 
+            void start();
+            void startLevel();
+            void levelUp();
+            void endLevel();
+
+
             inline int getNumberOfFlags() const
                 { return this->numberOfFlags_; }
 
@@ -62,6 +68,13 @@
             std::vector<HoverFlag*> flags_;
             int numberOfFlags_;
             bool firstTick_;
+            int level;
+            int lives;
+            int flagsTaken;
+
+            int cellSize;
+            int cellHeight;
+            int numCells;
     };
 }
 

Modified: code/branches/tgidronFS16/src/modules/hover/HoverShip.cc
===================================================================
--- code/branches/tgidronFS16/src/modules/hover/HoverShip.cc	2016-03-24 14:52:07 UTC (rev 11150)
+++ code/branches/tgidronFS16/src/modules/hover/HoverShip.cc	2016-03-24 14:53:28 UTC (rev 11151)
@@ -32,6 +32,7 @@
 #include "HoverShip.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
+//#include "NewHumanController.h"
 
 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
 
@@ -111,6 +112,7 @@
     void HoverShip::boost(bool bBoost) {
         if (bBoost && this->isFloor_)
         {
+
             this->setVelocity(
                 this->getVelocity().x,
                 jumpBoost_,




More information about the Orxonox-commit mailing list