Changeset 11381 for code/branches/SuperOrxoBros_FS17/src
- Timestamp:
- Mar 30, 2017, 2:42:31 PM (8 years ago)
- Location:
- code/branches/SuperOrxoBros_FS17/src/modules/superorxobros
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
r11378 r11381 41 41 #include "gamestates/GSLevel.h" 42 42 #include "chat/ChatManager.h" 43 #include "infos/PlayerInfo.h" 43 44 44 45 #include "SOBCenterpoint.h" 45 46 46 //#include "PongBat.h" 47 //#include "PongBot.h" 48 //#include "PongAI.h" 47 #include "SOBFigure.h" 48 #include "graphics/Camera.h" 49 49 50 50 namespace orxonox … … 60 60 { 61 61 RegisterObject(SOB); 62 camera = nullptr; 62 63 63 64 this->center_ = nullptr; 64 65 figure_ = nullptr; 65 66 66 67 } … … 76 77 } 77 78 78 79 void SOB::cleanup() 80 { 81 camera = nullptr; 82 } 79 83 80 84 void SOB::start() … … 85 89 { 86 90 figure_ = new SOBFigure(center_->getContext()); 87 figure_->addTemplate(center_->getFigureTemplate()); /88 figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@91 figure_->addTemplate(center_->getFigureTemplate()); 92 // figure_->InitializeAnimation(center_->getContext()); //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 89 93 } 90 94 … … 107 111 } 108 112 109 totalScreenShift_ = 0.0;110 screenShiftSinceLastUpdate_ = 0.0;111 sectionNumber_ = 0;112 adventureNumber_ = 0;113 // totalScreenShift_ = 0.0; 114 // screenShiftSinceLastUpdate_ = 0.0; 115 //sectionNumber_ = 0; 116 //adventureNumber_ = 0; 113 117 114 addStartSection();115 addSection();116 addSection();118 //addStartSection(); 119 // addSection(); 120 // addSection(); 117 121 } 118 122 -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h
r11378 r11381 56 56 void setCenterpoint(SOBCenterpoint* center) 57 57 { this->center_ = center; } 58 void setFigureTemplate(const std::string& newTemplate)59 { this->figureTemplate_ = newTemplate; }60 61 const std::string& getFigureTemplate() const62 { return this->figureTemplate_; } 63 58 virtual void start() override; 59 virtual void end() override; 60 virtual void spawnPlayer(PlayerInfo* player) override; 61 PlayerInfo* getPlayer() const; 62 63 64 64 65 65 protected: … … 70 70 WeakPtr<SOBFigure> figure_; 71 71 WeakPtr<Camera> camera; 72 72 73 73 74 }; -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.cc
r11379 r11381 21 21 * 22 22 * Author: 23 * Fabi an 'x3n' Landau23 * Fabien Vultier 24 24 * Co-authors: 25 25 * ... … … 28 28 29 29 /** 30 @file PongCenterpoint.cc31 @brief Implementation of the PongCenterpoint class.30 @file SOBCenterpoint.cc 31 @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint. 32 32 */ 33 33 … … 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 39 38 #include "SOB.h" 40 39 … … 43 42 RegisterClass(SOBCenterpoint); 44 43 45 /**46 @brief47 Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.48 */49 44 SOBCenterpoint::SOBCenterpoint(Context* context) : StaticEntity(context) 50 45 { 51 46 RegisterObject(SOBCenterpoint); 52 47 48 53 49 54 this->checkGametype();50 checkGametype(); 55 51 } 56 52 57 /**58 @brief59 Method to create a PongCenterpoint through XML.60 */61 53 void SOBCenterpoint::XMLPort(Element& xmlelement, XMLPort::Mode mode) 62 54 { 63 55 SUPER(SOBCenterpoint, XMLPort, xmlelement, mode); 64 56 65 //XMLPortParam(SOBCenterpoint, "dimension", setFieldDimension, getFieldDimension, xmlelement, mode); 66 //XMLPortParam(SOBCenterpoint, "balltemplate", setBalltemplate, getBalltemplate, xmlelement, mode); 67 // XMLPortParam(SOBCenterpoint, "battemplate", setBattemplate, getBattemplate, xmlelement, mode); 68 // XMLPortParam(SOBCenterpoint, "ballspeed", setBallSpeed, getBallSpeed, xmlelement, mode); 69 // XMLPortParam(SOBCenterpoint, "ballaccfactor", setBallAccelerationFactor, getBallAccelerationFactor, xmlelement, mode); 70 // XMLPortParam(SOBCenterpoint, "batspeed", setBatSpeed, getBatSpeed, xmlelement, mode); 71 // XMLPortParam(SOBCenterpoint, "batlength", setBatLength, getBatLength, xmlelement, mode); 57 58 XMLPortParam(SOBCenterpoint, "cameraOffset", setCameraOffset, getCameraOffset, xmlelement, mode); 59 60 XMLPortParam(SOBCenterpoint, "figureTemplate", setFigureTemplate, getFigureTemplate, xmlelement, mode); 61 72 62 } 73 63 74 /**75 @brief76 Checks whether the gametype is Pong and if it is, sets its centerpoint.77 */78 64 void SOBCenterpoint::checkGametype() 79 65 { 80 if ( this->getGametype() != nullptr && this->getGametype()->isA(Class(SOB)))66 if (getGametype() != nullptr && this->getGametype()->isA(Class(SOB))) 81 67 { 82 68 SOB* SOBGametype = orxonox_cast<SOB*>(this->getGametype()); -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBCenterpoint.h
r11379 r11381 1 /*2 1 /* 3 2 * ORXONOX - the hottest 3D action shooter ever to exist … … 22 21 * 23 22 * Author: 24 * Fabi an 'x3n' Landau23 * Fabien Vultier 25 24 * Co-authors: 26 25 * ... … … 28 27 */ 29 28 30 /**31 @file PongCenterpoint.h32 @brief Declaration of the PongCenterpoint class.33 @ingroup Pong34 */35 36 29 #ifndef _SOBCenterpoint_H__ 37 30 #define _SOBCenterpoint_H__ 38 31 39 32 #include "superorxobros/SOBPrereqs.h" 40 41 #include <string>42 43 #include <util/Math.h>44 45 33 #include "worldentities/StaticEntity.h" 46 34 … … 48 36 { 49 37 50 51 38 /** 39 @brief 40 @brief The SOBCenterpoint is a StaticEntity which represents the level of the minigame. All platforms, enemies and items are attached to the SOBCenterpoint. 41 */ 52 42 class _SOBExport SOBCenterpoint : public StaticEntity 53 43 { 54 44 public: 55 SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Pong.45 SOBCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually SOB. 56 46 virtual ~SOBCenterpoint() {} 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a SOBCenterpoint through XML. 48 49 void setFigureTemplate(const std::string& newTemplate) 50 { this->figureTemplate_ = newTemplate; } 51 const std::string& getFigureTemplate() const 52 { return this->figureTemplate_; } 53 57 54 58 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a PongCenterpoint through XML. 59 55 void setCameraOffset(const float cameraOffset) 56 { this->cameraOffset_ = cameraOffset; } 57 float getCameraOffset() const 58 { return cameraOffset_; } 59 private: 60 void checkGametype(); 61 62 std::string figureTemplate_; 60 63 61 62 private: 63 void checkGametype(); //!< Checks whether the gametype is Pong and if it is, sets its centerpoint. 64 65 float cameraOffset_; 64 66 }; 65 67 } -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
r11379 r11381 56 56 timeSinceLastFire_ = 0.0; 57 57 58 gravityAcceleration_ = 8.0;58 gravityAcceleration_ = 250.0;//8.0 59 59 60 60 dead_ = false; 61 setAngularFactor(0.0); 61 62 } 62 63 … … 80 81 81 82 82 velocity.z -= gravityAcceleration_; 83 83 84 84 85 … … 88 89 if (dead_ == false) 89 90 { 91 92 if (firePressed_ && std::abs(velocity.z) < 0.1) { 93 velocity.z = 200; 94 } else { 95 96 } 97 98 99 100 90 101 if (moveRightPressed_) 91 102 velocity.x = 75; 92 103 else if (moveLeftPressed_) 93 velocity.x = 75;104 velocity.x = -75; 94 105 else 95 106 velocity.x = 0; … … 99 110 velocity.x = 0.0; 100 111 } 112 velocity.z -= gravityAcceleration_*dt; 101 113 102 114 … … 116 128 moveDownPressed_ = false; 117 129 moveLeftPressed_ = false; 130 moveRightPressed_ = false; 118 131 moveDownPressed_ = false; 132 firePressed_ = false; 119 133 120 134 } … … 169 183 170 184 171 void SOBFigure:: fired(unsigned int firemode)172 {185 void SOBFigure::boost(bool boost) 186 { 173 187 firePressed_ = true; 174 188 } -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
r11379 r11381 46 46 47 47 48 virtual void fired(unsigned int firemode) override;48 virtual void boost(bool boost) override; 49 49 50 50 //virtual void CollisionWithEnemy(SOBEnemy* enemy);
Note: See TracChangeset
for help on using the changeset viewer.