[Orxonox-commit 7675] r12268 - in code/branches/OrxoBlox_FS19: data/levels data/overlays src/modules/OrxoBlox

ahuwyler at orxonox.net ahuwyler at orxonox.net
Thu Apr 4 14:40:29 CEST 2019


Author: ahuwyler
Date: 2019-04-04 14:40:29 +0200 (Thu, 04 Apr 2019)
New Revision: 12268

Added:
   code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo
Modified:
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
   code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBot.cc
Log:
OrxoBlox in the HUD

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-04-04 12:25:56 UTC (rev 12267)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-04-04 12:40:29 UTC (rev 12268)
@@ -8,12 +8,12 @@
 <?lua
   include("HUDTemplates3.oxo")
   include("stats.oxo")
-  include("pongHUD.oxo")
+  include("OrxoBloxHUD.oxo")
   include("templates/lodInformation.oxt")
 ?>
 
-<Template name=pongbatcameras defaults=0>
-  <PongBat>
+<Template name=OrxoBloxbatcameras defaults=0>
+  <OrxoBloxBat>
     <camerapositions>
       <CameraPosition position="0,150,0" pitch=-90 absolute=true />
       <CameraPosition position="0,50,160" drag=true mouselook=true />
@@ -20,20 +20,20 @@
       <CameraPosition position="0,40,125" drag=true mouselook=true />
       <CameraPosition position="0,30, 90" drag=true mouselook=true />
     </camerapositions>
-  </PongBat>
+  </OrxoBloxBat>
 </Template>
 
-<Template name=pongbat>
-  <PongBat camerapositiontemplate=pongbatcameras>
+<Template name=OrxoBloxbat>
+  <OrxoBloxBat camerapositiontemplate=OrxoBloxbatcameras>
     <attached>
       <Model position="0,0,3" mesh="cube.mesh" scale3D="14,2,2" />
-      <!--Model roll=180 mesh="pongbat.mesh" scale=0.045 /-->
+      <!--Model roll=180 mesh="OrxoBloxbat.mesh" scale=0.045 /-->
     </attached>
-  </PongBat>
+  </OrxoBloxBat>
 </Template>
 
-<Template name=pongball>
-  <PongBall 
+<Template name=OrxoBloxball>
+  <OrxoBloxBall 
    defScoreSound = "sounds/PlayerWinScore_cut.ogg"
    defBatSound = "sounds/Button.ogg"
    defBoundarySound = "sounds/Button.ogg">
@@ -47,7 +47,7 @@
     <eventlisteners>
       <EventTarget target=hiteffect />
     </eventlisteners>
-  </PongBall>
+  </OrxoBloxBall>
 </Template>
 
 
@@ -54,7 +54,7 @@
 
 <Level
   plugins = "OrxoBlox_FS19"
- gametype = "OrxoBlox"
+ gametype = "Pong"
 >
 
  <templates>
@@ -63,7 +63,7 @@
   <?lua include("includes/notifications.oxi") ?>
 
   <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
-  <PongBot />
+  <OrxoBloxBot />
 
   <Scene
    ambientlight = "0.5, 0.5, 0.5"
@@ -75,7 +75,7 @@
 
     <MovableEntity rotationrate=5 rotationaxis="0,0,1">
       <attached>
-        <PongCenterpoint name=pongcenter dimension="200,120" balltemplate=pongball battemplate=pongbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
+        <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="200,120" balltemplate=OrxoBloxball battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25>
           <attached>
             <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />
             <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />
@@ -96,12 +96,12 @@
             <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />
             <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />
 
-<!-- TODO: Create a Pong Score Sound and include it here.
+<!-- TODO: Create a OrxoBlox Score Sound and include it here.
 This WorldSound works, but doesn't make sense, since it is played together with ambient/moodDependedDirectory/Ganymede.ogg -->
-            <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/PongScore_cut.ogg" >
+            <!--WorldSound name="scoreSound" position="0,0,0" source="sounds/OrxoBloxScore_cut.ogg" >
               <events>
                 <play>
-                  <EventListener event=pongcenter />
+                  <EventListener event=OrxoBloxcenter />
                 </play>
               </events>
             </WorldSound-->
@@ -113,7 +113,7 @@
             <?lua end ?>
 
           </attached>
-        </PongCenterpoint>
+        </OrxoBloxCenterpoint>
       </attached>
     </MovableEntity>
 
@@ -128,7 +128,7 @@
             <names>
               <EventName name=right />
             </names>
-            <EventListener event=pongcenter />
+            <EventListener event=OrxoBloxcenter />
           </EventFilter>
         </spawn>
       </events>
@@ -144,7 +144,7 @@
             <names>
               <EventName name=left />
             </names>
-            <EventListener event=pongcenter />
+            <EventListener event=OrxoBloxcenter />
           </EventFilter>
         </spawn>
       </events>

Added: code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo
===================================================================
--- code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo	                        (rev 0)
+++ code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo	2019-04-04 12:40:29 UTC (rev 12268)
@@ -0,0 +1,70 @@
+<Template name="OrxoBloxHUD">
+  <OverlayGroup name="OrxoBloxHUD" scale = "1, 1">
+    <OrxoBloxScore
+     position  = "0.05, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.06
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     showleftplayer  = true
+     showrightplayer = false
+     showname        = true
+     showscore       = false
+    />
+
+    <OrxoBloxScore
+     position  = "0.49, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.06
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "right"
+
+     showleftplayer  = true
+     showrightplayer = false
+     showname        = false
+     showscore       = true
+    />
+
+    <OverlayText
+     position  = "0.505, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.06
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "center"
+
+     caption   = ":"
+    />
+
+    <OrxoBloxScore
+     position  = "0.51, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.06
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "left"
+
+     showleftplayer  = false
+     showrightplayer = true
+     showname        = false
+     showscore       = true
+    />
+
+    <OrxoBloxScore
+     position  = "0.95, 0.05"
+     pickpoint = "0.0, 0.0"
+     font      = "ShareTechMono"
+     textsize  = 0.06
+     colour    = "1.0, 1.0, 1.0, 1.0"
+     align     = "right"
+
+     showleftplayer  = false
+     showrightplayer = true
+     showname        = true
+     showscore       = false
+    />
+  </OverlayGroup>
+</Template>

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt	2019-04-04 12:25:56 UTC (rev 12267)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt	2019-04-04 12:40:29 UTC (rev 12268)
@@ -5,7 +5,7 @@
   BallGun/BallMunition.cc
   BallGun/BallProjectile.cc
   OrxoBlox.cc
-  OrxoBloxAI.cc
+  
   OrxoBloxBall.cc
   OrxoBloxBat.cc
   OrxoBloxBot.cc

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-04-04 12:25:56 UTC (rev 12267)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	2019-04-04 12:40:29 UTC (rev 12268)
@@ -45,7 +45,7 @@
 #include "OrxoBloxBall.h"
 #include "OrxoBloxBat.h"
 #include "OrxoBloxBot.h"
-#include "OrxoBloxAI.h"
+#include "OrxoBloxStones.h"
 
 namespace orxonox
 {
@@ -74,7 +74,7 @@
         this->starttimer_.stopTimer();
 
         // Set the type of Bots for this particular Gametype.
-        this->botclass_ = Class(OrxoBloxBot);
+        this->botclass_ = Class(OrxoBloxBat);
 
         this->scoreLimit_ = 10;
         this->setConfigValues();
@@ -192,6 +192,7 @@
     */
     void OrxoBlox::end()
     {
+        ChatManager::message("You suck!!");
         this->cleanup();
 
         // Call end for the parent class.
@@ -232,13 +233,6 @@
         }
         else
             return;
-
-        // If the player is an AI, it receives a pointer to the ball.
-        if (player->getController() != nullptr && player->getController()->isA(Class(OrxoBloxAI)))
-        {
-            OrxoBloxAI* ai = orxonox_cast<OrxoBloxAI*>(player->getController());
-            ai->setOrxoBloxBall(this->ball_);
-        }
     }
 
     /**
@@ -277,17 +271,7 @@
             
         }
 
-        // If a player gets enough points, he won the game -> end of game
-        PlayerInfo* winningPlayer = nullptr;
-        if (this->getLeftPlayer() && this->getScore(this->getLeftPlayer()) >= scoreLimit_)
-            winningPlayer = this->getLeftPlayer();
 
-        if (winningPlayer)
-        {
-             ChatManager::message(winningPlayer->getName() + " has won!");
-             this->end();
-        }
-
         // Restart the timer to start the ball.
         this->starttimer_.startTimer();
     }
@@ -316,11 +300,5 @@
             return nullptr;
     }
 
-    /**
-    @brief
-        Get the right player.
-    @return
-        Returns a pointer to the player playing on the right. If there is no right player, nullptr is returned.
-    */
     
 }

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-04-04 12:25:56 UTC (rev 12267)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h	2019-04-04 12:40:29 UTC (rev 12268)
@@ -83,7 +83,6 @@
             void setConfigValues(); //!< Makes scoreLimit configurable.
 
             PlayerInfo* getLeftPlayer() const; //!< Get the left player.
-            PlayerInfo* getRightPlayer() const; //!< Get the right player.
 
         protected:
             virtual void spawnPlayersIfRequested() override; //!< Spawns players, and fills the rest up with bots.

Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBot.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBot.cc	2019-04-04 12:25:56 UTC (rev 12267)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBot.cc	2019-04-04 12:40:29 UTC (rev 12268)
@@ -34,7 +34,6 @@
 #include "OrxoBloxBot.h"
 
 #include "core/CoreIncludes.h"
-#include "OrxoBloxAI.h"
 
 namespace orxonox
 {
@@ -48,7 +47,6 @@
     {
         RegisterObject(OrxoBloxBot);
 
-        this->defaultController_ = Class(OrxoBloxAI);
-        this->createController();
+        
     }
 }



More information about the Orxonox-commit mailing list