Index: /code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
===================================================================
--- /code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw (revision 11381)
@@ -1,56 +1,77 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+-
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -59,4 +80,15 @@
+
+
+
+
+
+
+
+
+
+
+
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc (revision 11381)
@@ -41,10 +41,10 @@
#include "gamestates/GSLevel.h"
#include "chat/ChatManager.h"
+#include "infos/PlayerInfo.h"
#include "SOBCenterpoint.h"
-//#include "PongBat.h"
-//#include "PongBot.h"
-//#include "PongAI.h"
+#include "SOBFigure.h"
+#include "graphics/Camera.h"
namespace orxonox
@@ -60,7 +60,8 @@
{
RegisterObject(SOB);
+ camera = nullptr;
this->center_ = nullptr;
- figure_ = nullptr;
+ figure_ = nullptr;
}
@@ -76,5 +77,8 @@
}
-
+ void SOB::cleanup()
+ {
+ camera = nullptr;
+ }
void SOB::start()
@@ -85,6 +89,6 @@
{
figure_ = new SOBFigure(center_->getContext());
- figure_->addTemplate(center_->getFigureTemplate()); /
- figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
+ figure_->addTemplate(center_->getFigureTemplate());
+ // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
}
@@ -107,12 +111,12 @@
}
- totalScreenShift_ = 0.0;
- screenShiftSinceLastUpdate_ = 0.0;
- sectionNumber_ = 0;
- adventureNumber_ = 0;
+ // totalScreenShift_ = 0.0;
+ // screenShiftSinceLastUpdate_ = 0.0;
+ //sectionNumber_ = 0;
+ //adventureNumber_ = 0;
- addStartSection();
- addSection();
- addSection();
+ //addStartSection();
+ // addSection();
+ // addSection();
}
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h (revision 11381)
@@ -56,10 +56,10 @@
void setCenterpoint(SOBCenterpoint* center)
{ this->center_ = center; }
- void setFigureTemplate(const std::string& newTemplate)
- { this->figureTemplate_ = newTemplate; }
-
- const std::string& getFigureTemplate() const
- { return this->figureTemplate_; }
-
+ virtual void start() override;
+ virtual void end() override;
+ virtual void spawnPlayer(PlayerInfo* player) override;
+ PlayerInfo* getPlayer() const;
+
+
protected:
@@ -70,4 +70,5 @@
WeakPtr figure_;
WeakPtr camera;
+
};
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc (revision 11381)
@@ -21,5 +21,5 @@
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
@@ -28,6 +28,6 @@
/**
- @file PongCenterpoint.cc
- @brief Implementation of the PongCenterpoint class.
+ @file SOBCenterpoint.cc
+ @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
*/
@@ -36,5 +36,4 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-
#include "SOB.h"
@@ -43,40 +42,27 @@
RegisterClass(SOBCenterpoint);
- /**
- @brief
- Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
- */
SOBCenterpoint::SOBCenterpoint(Context* context) : StaticEntity(context)
{
RegisterObject(SOBCenterpoint);
+
- this->checkGametype();
+ checkGametype();
}
- /**
- @brief
- Method to create a PongCenterpoint through XML.
- */
void SOBCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
SUPER(SOBCenterpoint, XMLPort, xmlelement, mode);
- //XMLPortParam(SOBCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode);
- //XMLPortParam(SOBCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode);
- // XMLPortParam(SOBCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode);
- // XMLPortParam(SOBCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode);
- // XMLPortParam(SOBCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode);
- // XMLPortParam(SOBCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode);
- // XMLPortParam(SOBCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode);
+
+ XMLPortParam(SOBCenterpoint, "cameraOffset", setCameraOffset, getCameraOffset, xmlelement, mode);
+
+ XMLPortParam(SOBCenterpoint, "figureTemplate", setFigureTemplate, getFigureTemplate, xmlelement, mode);
+
}
- /**
- @brief
- Checks whether the gametype is Pong and if it is, sets its centerpoint.
- */
void SOBCenterpoint::checkGametype()
{
- if (this->getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
+ if (getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))
{
SOB* SOBGametype = orxonox_cast(this->getGametype());
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h (revision 11381)
@@ -1,3 +1,2 @@
-/*
/*
* ORXONOX - the hottest 3D action shooter ever to exist
@@ -22,5 +21,5 @@
*
* Author:
- * Fabian 'x3n' Landau
+ * Fabien Vultier
* Co-authors:
* ...
@@ -28,19 +27,8 @@
*/
-/**
- @file PongCenterpoint.h
- @brief Declaration of the PongCenterpoint class.
- @ingroup Pong
-*/
-
#ifndef _SOBCenterpoint_H__
#define _SOBCenterpoint_H__
#include "superorxobros/SOBPrereqs.h"
-
-#include
-
-#include
-
#include "worldentities/StaticEntity.h"
@@ -48,18 +36,32 @@
{
-
-
+ /**
+ @brief
+ @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint.
+ */
class _SOBExport SOBCenterpoint : public StaticEntity
{
public:
- SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.
+ SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually SOB.
virtual ~SOBCenterpoint() {}
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a SOBCenterpoint through XML.
+
+ void setFigureTemplate(const std::string& newTemplate)
+ { this->figureTemplate_ = newTemplate; }
+ const std::string& getFigureTemplate() const
+ { return this->figureTemplate_; }
+
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a PongCenterpoint through XML.
-
+ void setCameraOffset(const float cameraOffset)
+ { this->cameraOffset_ = cameraOffset; }
+ float getCameraOffset() const
+ { return cameraOffset_; }
+ private:
+ void checkGametype();
+
+ std::string figureTemplate_;
-
- private:
- void checkGametype(); //!< Checks whether the gametype is Pong and if it is, sets its centerpoint.
+
+ float cameraOffset_;
};
}
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc (revision 11381)
@@ -56,7 +56,8 @@
timeSinceLastFire_ = 0.0;
- gravityAcceleration_ = 8.0;
+ gravityAcceleration_ = 250.0;//8.0
dead_ = false;
+ setAngularFactor(0.0);
}
@@ -80,5 +81,5 @@
- velocity.z -= gravityAcceleration_;
+
@@ -88,8 +89,18 @@
if (dead_ == false)
{
+
+ if (firePressed_ && std::abs(velocity.z) < 0.1) {
+ velocity.z = 200;
+ } else {
+
+ }
+
+
+
+
if (moveRightPressed_)
velocity.x = 75;
else if (moveLeftPressed_)
- velocity.x = 75;
+ velocity.x = -75;
else
velocity.x = 0;
@@ -99,4 +110,5 @@
velocity.x = 0.0;
}
+ velocity.z -= gravityAcceleration_*dt;
@@ -116,5 +128,7 @@
moveDownPressed_ = false;
moveLeftPressed_ = false;
+ moveRightPressed_ = false;
moveDownPressed_ = false;
+ firePressed_ = false;
}
@@ -169,6 +183,6 @@
- void SOBFigure::fired(unsigned int firemode)
- {
+ void SOBFigure::boost(bool boost)
+ {
firePressed_ = true;
}
Index: /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
===================================================================
--- /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h (revision 11380)
+++ /code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h (revision 11381)
@@ -46,5 +46,5 @@
- virtual void fired(unsigned int firemode) override;
+ virtual void boost(bool boost) override;
//virtual void CollisionWithEnemy(SOBEnemy* enemy);