Index: /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
===================================================================
--- /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw (revision 12143)
+++ /code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw (revision 12144)
@@ -71,5 +71,5 @@
team=0
- position=",40,"
+ position=",40,"
lookat="0,40,0"
spawnclass=OrxoKartKart
Index: /code/branches/OrxoKart_HS18/data/levels/OrxoKart2.oxw
===================================================================
--- /code/branches/OrxoKart_HS18/data/levels/OrxoKart2.oxw (revision 12144)
+++ /code/branches/OrxoKart_HS18/data/levels/OrxoKart2.oxw (revision 12144)
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /code/branches/OrxoKart_HS18/data/overlays/OrxoKartHUD.oxo
===================================================================
--- /code/branches/OrxoKart_HS18/data/overlays/OrxoKartHUD.oxo (revision 12143)
+++ /code/branches/OrxoKart_HS18/data/overlays/OrxoKartHUD.oxo (revision 12144)
@@ -17,24 +17,10 @@
/>
-
-
-
-
-
+
+
Index: /code/branches/OrxoKart_HS18/data/tcl/orxokart_highscores.txt
===================================================================
--- /code/branches/OrxoKart_HS18/data/tcl/orxokart_highscores.txt (revision 12144)
+++ /code/branches/OrxoKart_HS18/data/tcl/orxokart_highscores.txt (revision 12144)
@@ -0,0 +1,14 @@
+Name: 0:25:73s
+Name: 0:24:43s
+Name: 0:22:04s
+Name: 0:21:66s
+Name: 0:21:83s
+Name: 0:21:87s
+Name: 0:22:06s
+Name: 0:22:19s
+Name: 0:23:77s
+Name: 0:21:05s
+Name: 0:21:25s
+Name: 0:21:15s
+Name: 0:22:15s
+Name: 0:21:87s
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt (revision 12144)
@@ -5,4 +5,5 @@
OrxoKartOrigin.cc
OrxoKartFlag.cc
+ ShroomHUD.cc
TimeHUD.cc
)
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc (revision 12144)
@@ -50,4 +50,5 @@
this->raceFinished = false;
this->firstTick_ = true;
+ this->numberOfShrooms = 3;
this->setHUDTemplate("OrxoKartHUD");
@@ -181,7 +182,7 @@
OrxoKartKart* player = flag_->getObjectofCollision();
if (level == 1)
- player->setPosition(Vector3(s*0, 20, s*8));
+ player->setPosition(Vector3(s*0, 20, s*8.5));
if (level == 2)
- player->setPosition(Vector3(s*0, 20, s*18));
+ player->setPosition(Vector3(s*0, 20, s*18.5));
player->setOrientation(Quaternion(1, 0, 0, 0)); // 0, 0, 0
player->setVelocity(Vector3(0,0,0));
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h (revision 12144)
@@ -57,4 +57,6 @@
inline int getRaceFinished() const
{ return this->raceFinished; }
+ inline int getNumberOfShrooms() const
+ { return this->numberOfShrooms; }
private:
@@ -68,4 +70,6 @@
bool firstTick_;
+ int numberOfShrooms;
+
int s;
int n;
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartPrereqs.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartPrereqs.h (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartPrereqs.h (revision 12144)
@@ -74,4 +74,5 @@
class OrxoKartTile;
class TimeHUD;
+ class ShroomHUD;
}
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc (revision 12144)
@@ -48,4 +48,5 @@
this->model_ = nullptr;
this->cs_ = nullptr;
+ this->arc = nullptr;
this->enableCollisionCallback();
@@ -66,4 +67,6 @@
if (this->cs_)
this->cs_->destroy();
+ if (this->arc)
+ this->arc->destroy();
}
}
@@ -90,4 +93,11 @@
else if (type == 2 ) {
model_->setMeshSource("OrxoKartStreckenabschnittZiel.mesh");
+
+ arc = new Model(this->getContext());
+ arc->setMeshSource("OrxoKartStartTor.mesh");
+ arc->setPosition(Vector3(x*1.0f, -1.0f, z*1.0f));
+ arc->setScale3D(Vector3(s*1.0f/10, s*1.0f/10, s*1.0f/10));
+ arc->yaw(Degree(-90));
+ this->attach(arc);
}
model_->setScale3D(Vector3(s*1.0f, 8.0f, s*1.0f));
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h (revision 12143)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h (revision 12144)
@@ -65,4 +65,5 @@
private:
Model* model_;
+ Model* arc;
BoxCollisionShape* cs_;
bool collided_;
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.cc
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.cc (revision 12144)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.cc (revision 12144)
@@ -0,0 +1,109 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Cyrill Burgener
+ *
+ */
+
+/**
+ @file ShroomHUD.cc
+ @brief Implementation of the ShroomHUD
+*/
+
+#include "ShroomHUD.h"
+
+#if OGRE_VERSION >= 0x010900
+# include
+# include
+#else
+# include
+# include
+#endif
+
+#include "util/StringUtils.h"
+#include "core/CoreIncludes.h"
+#include "OrxoKart.h"
+
+namespace orxonox
+{
+ RegisterClass(ShroomHUD);
+
+ ShroomHUD::ShroomHUD(Context* context) : OrxonoxOverlay(context)
+ {
+ RegisterObject(ShroomHUD);
+
+ this->orxoKartGame_ = nullptr;
+ this->panel_ = static_cast(Ogre::OverlayManager::getSingleton()
+ .createOverlayElement("Panel", "ShroomHUD_Panel_" + getUniqueNumberString()));
+ this->panel_->setMaterialName("Hover/Flag");
+ this->overlay_->add2D(this->panel_);
+ this->shroomCount_ = 3;
+ setShroomCount(3);
+ }
+
+ ShroomHUD::~ShroomHUD()
+ {
+ if (this->isInitialized())
+ {
+ Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->panel_);
+ }
+ }
+
+/**
+ @brief Sets the amount of shrooms displayed, once zero it does not reappear
+ @param shroomCount
+*/
+ void ShroomHUD::setShroomCount(int shroomCount) {
+ if(shroomCount == 0){
+ this->panel_->hide();
+ return;
+ }
+ this->panel_->setDimensions(
+ this->panel_->_getRelativeWidth() / ((float) shroomCount_) * ((float) shroomCount),
+ this->panel_->_getRelativeHeight()
+ );
+ this->panel_->setTiling(shroomCount*1.0f, 1.0f);
+
+ this->shroomCount_ = shroomCount;
+ }
+
+ void ShroomHUD::tick(float dt)
+ {
+ SUPER(ShroomHUD, tick, dt);
+
+ setShroomCount(this->orxoKartGame_->getNumberOfShrooms());
+ }
+
+ void ShroomHUD::changedOwner()
+ {
+ SUPER(ShroomHUD, changedOwner);
+
+ if (this->getOwner() && this->getOwner()->getGametype())
+ {
+ this->orxoKartGame_ = orxonox_cast(this->getOwner()->getGametype());
+ }
+ else
+ {
+ this->orxoKartGame_ = nullptr;
+ }
+ }
+}
Index: /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.h
===================================================================
--- /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.h (revision 12144)
+++ /code/branches/OrxoKart_HS18/src/modules/orxokart/ShroomHUD.h (revision 12144)
@@ -0,0 +1,62 @@
+/*
+ *
+ *
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Cyrill Burgener
+ *
+ */
+
+ /**
+ @file ShroomHUD.h
+ @brief Declaration of the ShroomHUD class.
+*/
+
+#ifndef _ShroomHUD_H__
+#define _ShroomHUD_H__
+
+#include "OrxoKartPrereqs.h"
+
+#include "util/OgreForwardRefs.h"
+#include "overlays/OrxonoxOverlay.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+ class _OrxoKartExport ShroomHUD : public OrxonoxOverlay , public Tickable
+ {
+ public:
+ ShroomHUD(Context* context);
+ virtual ~ShroomHUD();
+
+ virtual void tick(float dt) override;
+ virtual void changedOwner() override;
+
+ void setShroomCount(int shroomCount);
+
+ private:
+ OrxoKart* orxoKartGame_;
+ Ogre::PanelOverlayElement* panel_;
+ int shroomCount_;
+ };
+}
+#endif /* _ShroomHUD_H__ */