Changeset 11381 for code/branches/SuperOrxoBros_FS17
- Timestamp:
- Mar 30, 2017, 2:42:31 PM (8 years ago)
- Location:
- code/branches/SuperOrxoBros_FS17
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/data/levels/SOB.oxw
r11379 r11381 1 1 <LevelInfo 2 name = "SOOOO B"3 description = " Level for the coding tutorial."2 name = "SOOOOOOOOOOOB" 3 description = "Jump as high as you can. Use the mouse to guide the jumper." 4 4 tags = "minigame" 5 screenshot = "codingtutorial.png" 6 startingships = "spaceshipassff, spaceshipghost, spaceshipspacecruiser" 5 screenshot = "jump.png" 7 6 /> 8 7 9 8 <?lua 10 include("HUDTemplates3.oxo") 9 include("HUDTemplates3.oxo") 10 include("jumpHUD.oxo") 11 11 include("stats.oxo") 12 include("templates/spaceshipAssff.oxt") 13 12 include("templates/lodInformation.oxt") 14 13 ?> 15 14 16 <Level plugins = "superorxobros" gametype="SOB"> 17 15 <Template name=sobfigurecameras defaults=0> 16 <SOBFigure> 17 <camerapositions> 18 <CameraPosition position="0,-150,0" absolute=false mouselook=false drag=false lookat="0,0,0"/> 19 </camerapositions> 20 </SOBFigure> 21 </Template> 18 22 23 24 25 26 <Template name=sobFigureTemplate> 27 <SOBFigure camerapositiontemplate=sobfigurecameras collisionType="dynamic"> 28 <attached> 29 <Model position="0,0,0" mesh="JumpFigure.mesh" scale=1 pitch=90/> 30 </attached> 31 32 <collisionShapes> 33 <!-- <BoxCollisionShape position="0,0,0" halfExtents="3,3,3" /> 34 --> <SphereCollisionShape yaw="20" pitch="20" roll="20" position="0,0,0" radius="10" /> 35 </collisionShapes> 36 37 38 </SOBFigure> 39 </Template> 40 41 <Level 42 plugins = "superorxobros" 43 gametype = "SOB" 44 >- 45 46 47 <templates> 48 <Template link=lodtemplate_default /> 49 </templates> 19 50 <?lua include("includes/notifications.oxi") ?> 20 51 21 <Scene 22 ambientlight = "0.5, 0.5, 0.5" 23 skybox = "Orxonox/skyBoxBasic" 24 > 52 <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/> 53 54 55 <Scene ambientlight="1.0, 1.0, 1.0" skybox="Orxonox/skyBoxBasic"> 56 <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" /> 57 58 <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" /> 59 60 <MovableEntity> 61 <attached> 62 <SOBCenterpoint 63 name=jumpcenter 64 65 cameraOffset="10" 66 67 68 figureTemplate=sobFigureTemplate 69 70 > 71 72 <attached> 25 73 26 74 27 75 28 <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" />29 <SpawnPoint position="991.729, -110.11, 435.404" orientation="0.534038, 0.563456, 0.212168, 0.593553" spawnclass=SpaceShip pawndesign=shipselection />30 31 32 33 <MovableEntity rotationrate=5 rotationaxis="0,0,1">34 <attached>35 <SOBCenterpoint>36 <attached>37 <Model position="0,0,60" mesh="cube.mesh" scale3D="105,1,1" />38 <Model position="0,0,-60" mesh="cube.mesh" scale3D="105,1,1" />39 40 <ParticleSpawner name=scoreeffect_right position="120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />41 <ParticleSpawner name=scoreeffect_right position="120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />42 <ParticleSpawner name=scoreeffect_right position="120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />43 <ParticleSpawner name=scoreeffect_right position="120,0, 0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />44 <ParticleSpawner name=scoreeffect_right position="120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />45 <ParticleSpawner name=scoreeffect_right position="120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />46 <ParticleSpawner name=scoreeffect_right position="120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />47 48 <ParticleSpawner name=scoreeffect_left position="-120,0, 45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />49 <ParticleSpawner name=scoreeffect_left position="-120,0, 30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />50 <ParticleSpawner name=scoreeffect_left position="-120,0, 15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />51 <ParticleSpawner name=scoreeffect_left position="-120,0, 0" source="Orxonox/BigExplosion1part2" lifetime=0.1 autostart=0 />52 <ParticleSpawner name=scoreeffect_left position="-120,0,-15" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />53 <ParticleSpawner name=scoreeffect_left position="-120,0,-30" source="Orxonox/BigExplosion1part2" lifetime=3.0 autostart=0 />54 <ParticleSpawner name=scoreeffect_left position="-120,0,-45" source="Orxonox/sparks2" lifetime=0.1 autostart=0 />55 76 56 77 </attached> … … 59 80 </MovableEntity> 60 81 82 <StaticEntity position="0,-1,-10" collisionType="static"> 83 <attached> 84 <Model mesh="cube.mesh" scale3D="76,76,1" /> 85 </attached> 86 87 <collisionShapes> 88 <BoxCollisionShape position="0,0,0" halfExtents="76,76,1" /> 89 </collisionShapes> 90 </StaticEntity> 91 92 61 93 62 94 -
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.