[Orxonox-commit 5521] r10184 - in code/branches/pickupsFS14: data/levels data/overlays src/modules/jump

fvultier at orxonox.net fvultier at orxonox.net
Wed Dec 17 15:43:08 CET 2014


Author: fvultier
Date: 2014-12-17 15:43:07 +0100 (Wed, 17 Dec 2014)
New Revision: 10184

Modified:
   code/branches/pickupsFS14/data/levels/emptyLevel.oxw
   code/branches/pickupsFS14/data/levels/jump.oxw
   code/branches/pickupsFS14/data/overlays/jumpHUD.oxo
   code/branches/pickupsFS14/src/modules/jump/Jump.cc
   code/branches/pickupsFS14/src/modules/jump/Jump.h
   code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc
   code/branches/pickupsFS14/src/modules/jump/JumpBoots.h
   code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
   code/branches/pickupsFS14/src/modules/jump/JumpFigure.h
   code/branches/pickupsFS14/src/modules/jump/JumpItem.h
   code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc
   code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h
   code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc
   code/branches/pickupsFS14/src/modules/jump/JumpRocket.h
   code/branches/pickupsFS14/src/modules/jump/JumpScore.cc
   code/branches/pickupsFS14/src/modules/jump/JumpScore.h
   code/branches/pickupsFS14/src/modules/jump/JumpShield.cc
   code/branches/pickupsFS14/src/modules/jump/JumpShield.h
Log:
Es wird nun angezeigt, wie lange ein item noch aktiv ist.

Modified: code/branches/pickupsFS14/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/pickupsFS14/data/levels/emptyLevel.oxw	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/data/levels/emptyLevel.oxw	2014-12-17 14:43:07 UTC (rev 10184)
@@ -23,6 +23,17 @@
   </templates>
   <?lua include("includes/notifications.oxi") ?>
 
+	<NotificationQueueCEGUI
+    name="narrative"
+    targets="simpleNotification"
+    size=3
+    displayTime=3.9
+    position="0.2, 0, 0.1, 0"
+    fontSize="23"
+    fontColor="0.3, 1, 0.2, 0.8"
+    alignment="HorzCentred"
+    displaySize="0.6, 0, 0, 0"
+    />
   <Scene
     ambientlight = "0.8, 0.8, 0.8"
     skybox       = "Orxonox/Starbox"
@@ -30,6 +41,34 @@
 
     <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
     <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+	<Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 4" >
+        <events>
+          <visibility>
+            <EventListener event="flying4" />
+          </visibility>
+        </events>
+        <attached>
+            <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+        </attached>
+        <collisionShapes>
+            <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+        </collisionShapes>
+        <controller>
+            <WaypointController team=1>
+            </WaypointController>
+        </controller>
+    </Pawn>
+
+
+
+<SimpleNotification message="Right click on the next target." broadcast="true">
+        <events>
+            <trigger>
+                <EventListener event="box" />
+            </trigger>
+        </events>
+    </SimpleNotification>
     
   </Scene>
 </Level>

Modified: code/branches/pickupsFS14/data/levels/jump.oxw
===================================================================
--- code/branches/pickupsFS14/data/levels/jump.oxw	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/data/levels/jump.oxw	2014-12-17 14:43:07 UTC (rev 10184)
@@ -242,13 +242,15 @@
             <Model position="0,0,-1000" mesh="JumpPlatform05.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpPlatform06.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpProjectile.mesh" scale="1" />
-            <Model position="0,0,-1000" mesh="JumpFigure.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy1.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy2.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy3.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpEnemy4.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpSpring.mesh" scale="1" />
             <Model position="0,0,-1000" mesh="JumpRocket.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpPropeller.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpBoots.mesh" scale="1" />
+            <Model position="0,0,-1000" mesh="JumpShield.mesh" scale="1" />
           </attached>
         </JumpCenterpoint>
       </attached>

Modified: code/branches/pickupsFS14/data/overlays/jumpHUD.oxo
===================================================================
--- code/branches/pickupsFS14/data/overlays/jumpHUD.oxo	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/data/overlays/jumpHUD.oxo	2014-12-17 14:43:07 UTC (rev 10184)
@@ -1,5 +1,6 @@
 <Template name="JumpHUD">
   <OverlayGroup name="JumpHUD" scale = "1, 1">
+
     <JumpScore
      position  = "0.5, 0.05"
      pickpoint = "0.0, 0.0"
@@ -8,10 +9,23 @@
      colour    = "1.0, 1.0, 1.0, 1.0"
      align     = "center"
      showScore = true
+     showFuel = false
      showMessages = false
     />
 
     <JumpScore
+     position  = "0.1, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.05
+     colour    = "1.0, 0.5, 0.0, 1.0"
+     align     = "left"
+     showScore = false
+     showFuel = true
+     showMessages = false
+    /> 
+
+    <JumpScore
      position  = "0.5, 0.5"
      pickpoint = "0.0, 0.0"
      font      = "ShareTechMono"
@@ -20,8 +34,25 @@
      align     = "center"
      gameOverText = "GAME OVER"
      showScore = false
+     showFuel = false
      showMessages = true
-    />    
+    />       
 
+  <HUDBar
+     name          = "SpeedBar1"
+     background    = "Orxonox/BarBackground"
+     size          = "0.35, 0.05"
+     position      = "0.0 , 1.0 "
+     pickpoint     = "0, 1"
+     correctaspect = false
+
+     initialvalue = 50
+
+     >
+      <BarColour position = 0.0 colour = "0.7,0.5,0.2" />
+      <BarColour position = 0.5 colour = "0.2,0.7,0.2" />
+      <BarColour position = 1.0 colour = "0.7,0.2,0.2" />
+    </HUDBar>
+
   </OverlayGroup>
 </Template>

Modified: code/branches/pickupsFS14/src/modules/jump/Jump.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/Jump.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/Jump.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -1270,6 +1270,31 @@
         return sectionNumber_ - 2;
     }
 
+    float Jump::getFuel() const
+    {
+        if (this->figure_ != NULL)
+        {
+            if (this->figure_->rocketActive_ != NULL)
+            {
+                return this->figure_->rocketActive_->getFuelState();
+            }
+            else if (this->figure_->propellerActive_ != NULL)
+            {
+                return this->figure_->propellerActive_->getFuelState();
+            }
+            else if (this->figure_->shieldActive_ != NULL)
+            {
+                return this->figure_->shieldActive_->getFuelState();
+            }
+            else if (this->figure_->bootsActive_ != NULL)
+            {
+                return this->figure_->bootsActive_->getFuelState();
+            }            
+        }
+
+        return 0.0;
+    }
+
     bool Jump::getDead(PlayerInfo* player) const
     {
         return figure_->dead_;

Modified: code/branches/pickupsFS14/src/modules/jump/Jump.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/Jump.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/Jump.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -20,7 +20,7 @@
  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *   Author:
- *      Fabian 'x3n' Landau
+ *      Fabien Vultier
  *   Co-authors:
  *      ...
  *
@@ -48,6 +48,7 @@
             virtual void end();
             virtual void spawnPlayer(PlayerInfo* player);
             int getScore(PlayerInfo* player) const;
+            float getFuel() const;
             bool getDead(PlayerInfo* player) const;
             void setCenterpoint(JumpCenterpoint* center)
                 { center_ = center; }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpBoots);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -101,4 +102,9 @@
 
     	attachedToFigure_ = figure_->StartBoots(this);
     }
+
+    float JumpBoots::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpBoots.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpBoots.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpBoots.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -44,9 +44,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -69,10 +69,10 @@
         handAngle_ = 0.0;
         animateHands_ = false;
         turnUp_ = false;
-        rocketActive_ = false;
-        propellerActive_ = false;
-        bootsActive_ = false;
-        shieldActive_ = false;
+        rocketActive_ = NULL;
+        propellerActive_ = NULL;
+        bootsActive_ = NULL;
+        shieldActive_ = NULL;
         rocketSpeed_ = 0.0;
         propellerSpeed_ = 0.0;
         dead_ = false;
@@ -105,11 +105,11 @@
 
         	// Move up/down
         	Vector3 velocity = getVelocity();
-        	if (rocketActive_ == true)
+        	if (rocketActive_ != NULL)
         	{
         		velocity.z = rocketSpeed_;
         	}
-        	else if (propellerActive_ == true)
+        	else if (propellerActive_ != NULL)
         	{
         		velocity.z = propellerSpeed_;
         	}
@@ -206,9 +206,15 @@
     	if (dead_ == false)
     	{
         	Vector3 velocity = getVelocity();
-        	velocity.z = (bootsActive_ ? 1.2*jumpSpeed_ : jumpSpeed_);
+            if (bootsActive_ == NULL)
+            {
+                velocity.z = 1.2*jumpSpeed_;
+            }
+            else
+            {
+                velocity.z = jumpSpeed_;
+            }
         	setVelocity(velocity);
-
         	animateHands_ = true;
         	handAngle_ = 0.0;
         	turnUp_ = true;
@@ -227,7 +233,7 @@
 
     void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy)
 	{
-    	if (rocketActive_ == false && propellerActive_ == false && shieldActive_ == false)
+    	if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)
 		{
 			dead_ = true;
 		}
@@ -235,12 +241,12 @@
 
     bool JumpFigure::StartRocket(JumpRocket* rocket)
     {
-    	if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+    	if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     	{
         	attach(rocket);
         	rocket->setPosition(0.0, rocketPos_, 0.0);
         	rocket->setVelocity(0.0, 0.0, 0.0);
-        	rocketActive_ = true;
+        	rocketActive_ = rocket;
 
         	return true;
     	}
@@ -254,17 +260,17 @@
     	rocket->setVelocity(0.0, 0.0, 0.0);
     	detach(rocket);
 		rocket->destroy();
-		rocketActive_ = false;
+		rocketActive_ = NULL;
     }
 
     bool JumpFigure::StartPropeller(JumpPropeller* propeller)
     {
-    	if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+    	if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     	{
         	attach(propeller);
         	propeller->setPosition(0.0, 0.0, propellerPos_);
         	propeller->setVelocity(0.0, 0.0, 0.0);
-        	propellerActive_ = true;
+        	propellerActive_ = propeller;
 
         	return true;
     	}
@@ -278,17 +284,17 @@
     	propeller->setVelocity(0.0, 0.0, 0.0);
     	detach(propeller);
     	propeller->destroy();
-    	propellerActive_ = false;
+    	propellerActive_ = NULL;
     }
 
     bool JumpFigure::StartBoots(JumpBoots* boots)
     {
-    	if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)
+    	if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)
     	{
         	attach(boots);
         	boots->setPosition(0.0, 0.0, bootsPos_);
         	boots->setVelocity(0.0, 0.0, 0.0);
-        	bootsActive_ = true;
+        	bootsActive_ = boots;
 
         	return true;
     	}
@@ -302,7 +308,7 @@
     	boots->setVelocity(0.0, 0.0, 0.0);
     	detach(boots);
     	boots->destroy();
-    	bootsActive_ = false;
+    	bootsActive_ = NULL;
     }
 
     bool JumpFigure::StartShield(JumpShield* shield)
@@ -312,7 +318,7 @@
         	attach(shield);
         	shield->setPosition(0.0, 0.0, propellerPos_);
         	shield->setVelocity(0.0, 0.0, 0.0);
-        	shieldActive_ = true;
+        	shieldActive_ = shield;
 
         	return true;
     	}
@@ -326,7 +332,7 @@
     	shield->setVelocity(0.0, 0.0, 0.0);
     	detach(shield);
     	shield->destroy();
-    	shieldActive_ = false;
+    	shieldActive_ = NULL;
     }
 
     void JumpFigure::InitializeAnimation(Context* context)

Modified: code/branches/pickupsFS14/src/modules/jump/JumpFigure.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpFigure.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpFigure.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -30,7 +30,6 @@
 #define _JumpFigure_H__
 
 #include "jump/JumpPrereqs.h"
-
 #include "worldentities/ControllableEntity.h"
 
 namespace orxonox
@@ -118,9 +117,12 @@
                 { return handSpeed_; }
 
             bool fireSignal_;
-            bool rocketActive_;
-            bool propellerActive_;
             bool dead_;
+
+            JumpRocket* rocketActive_;
+            JumpPropeller* propellerActive_;
+            JumpBoots* bootsActive_;
+            JumpShield* shieldActive_;
         private:
             std::string modelLeftHand_;
             std::string modelRightHand_;
@@ -148,8 +150,6 @@
             float handAngle_;
             bool animateHands_;
             bool turnUp_;
-            bool bootsActive_;
-            bool shieldActive_;
             float rocketSpeed_;
             float propellerSpeed_;
     };

Modified: code/branches/pickupsFS14/src/modules/jump/JumpItem.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpItem.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpItem.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -52,7 +52,7 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed);
-            virtual void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.
+            virtual void setFigure(WeakPtr<JumpFigure> bats);
             virtual void touchFigure();
 
             void setFieldDimension(float width, float height)
@@ -73,9 +73,9 @@
             bool attachedToFigure_;
 
         protected:
-            float fieldWidth_; //!< The width of the playing field.
-            float fieldHeight_; //!< The height of the playing field.
-            WeakPtr<JumpFigure> figure_; //!< An array with the two bats.
+            float fieldWidth_;
+            float fieldHeight_;
+            WeakPtr<JumpFigure> figure_;
             float height_;
             float width_;
             float leftBoundary_;

Modified: code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpPropeller);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -105,4 +106,9 @@
     		setAngularVelocity(Vector3(0,0,10.0));
     	}
     }
+
+    float JumpPropeller::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -46,9 +46,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -48,7 +48,8 @@
     {
         RegisterObject(JumpRocket);
 
-        fuel_ = 3.0;
+        initialFuel_ = 3.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -98,4 +99,9 @@
 
     	attachedToFigure_ = figure_->StartRocket(this);
     }
+
+    float JumpRocket::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpRocket.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpRocket.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpRocket.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -43,9 +43,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 

Modified: code/branches/pickupsFS14/src/modules/jump/JumpScore.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpScore.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpScore.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -49,6 +49,7 @@
 
         owner_ = NULL;
         showScore_ = false;
+        showFuel_ = false;
         showMessages_ = false;
     }
 
@@ -62,6 +63,7 @@
         SUPER(JumpScore, XMLPort, xmlelement, mode);
 
         XMLPortParam(JumpScore, "showScore", setShowScore, getShowScore, xmlelement, mode);
+        XMLPortParam(JumpScore, "showFuel", setShowFuel, getShowFuel, xmlelement, mode);
         XMLPortParam(JumpScore, "showMessages", setShowMessages, getShowMessages, xmlelement, mode);
         XMLPortParam(JumpScore, "gameOverText", setGameOverText, getGameOverText, xmlelement, mode);
     }
@@ -85,9 +87,24 @@
                     	std::string str = multi_cast<std::string>(score);
                     	setCaption(str);
                 	}
+                    else if (showFuel_ == true)
+                    {
+                        float fuel = owner_->getFuel();
+                        orxout() <<  fuel << endl;
+                        std::string str;
+
+                        if (fuel <= 0.0)
+                        {
+                            str = "";
+                        }
+                        else
+                        {
+                            str = multi_cast<std::string>(fuel);
+                        }
+                        setCaption(str);
+                    }                    
                 	else if (showMessages_ == true)
                 	{
-
                     	setCaption(owner_->getDead(player_) == true ? gameOverText_ : "");
                 	}
                 }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpScore.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpScore.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpScore.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -53,11 +53,17 @@
             const bool getShowScore() const
                 { return showScore_; }
 
+            void setShowFuel(const bool showFuel)
+                { showFuel_ = showFuel; }
+
+            const bool getShowFuel() const
+                { return showFuel_; }
+
             void setShowMessages(const bool showMessages)
                 { showMessages_ = showMessages; }
 
             const bool getShowMessages() const
-                { return showMessages_; }
+                { return showMessages_; }                
 
             void setGameOverText(const std::string& gameOverText)
                 { this->gameOverText_ = gameOverText; }
@@ -70,6 +76,7 @@
             WeakPtr<PlayerInfo> player_;
             WorldSound* scoreSound_;
             bool showScore_;
+            bool showFuel_;
             bool showMessages_;
             std::string gameOverText_;
     };

Modified: code/branches/pickupsFS14/src/modules/jump/JumpShield.cc
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShield.cc	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShield.cc	2014-12-17 14:43:07 UTC (rev 10184)
@@ -51,7 +51,8 @@
     {
         RegisterObject(JumpShield);
 
-        fuel_ = 7.0;
+        initialFuel_ = 7.0;
+        fuel_ = initialFuel_;
         attachedToFigure_ = false;
 
         setPosition(Vector3(0,0,0));
@@ -101,4 +102,9 @@
 
     	attachedToFigure_ = figure_->StartShield(this);
     }
+
+    float JumpShield::getFuelState()
+    {
+        return fuel_/initialFuel_;
+    }
 }

Modified: code/branches/pickupsFS14/src/modules/jump/JumpShield.h
===================================================================
--- code/branches/pickupsFS14/src/modules/jump/JumpShield.h	2014-12-15 15:43:10 UTC (rev 10183)
+++ code/branches/pickupsFS14/src/modules/jump/JumpShield.h	2014-12-17 14:43:07 UTC (rev 10184)
@@ -46,9 +46,11 @@
             virtual void tick(float dt);
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
             virtual void touchFigure();
+            virtual float getFuelState();
         protected:
             float stretch_;
             float fuel_;
+            float initialFuel_;
     };
 }
 




More information about the Orxonox-commit mailing list