- Timestamp:
- Nov 27, 2017, 3:29:03 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/data/levels/FlappyOrx.oxw
r11596 r11600 5 5 screenshot = "orxonoxArcade.png" 6 6 /> 7 7 <FlappyOrx 8 spawnDistance=50 9 Speed = 700 /> 8 10 <?lua 11 include("includes/notifications.oxi") 9 12 include("templates/lodInformation.oxt") 10 13 include("templates/spaceshipFlappyOrx.oxt") … … 37 40 <FlappyOrxCenterPoint name=flappyorxcenter /> 38 41 42 43 39 44 <?lua 40 45 for i = 1, 5, 1 do -
code/branches/FlappyOrx_HS17/data/levels/templates/spaceshipFlappyOrx.oxt
r11596 r11600 22 22 enablecollisiondamage = true 23 23 24 speed = 10024 25 25 UpwardThrust = 200 26 gravity = 50026 Gravity = 700 27 27 > 28 28 <engines> … … 37 37 <SphereCollisionShape position="-1.8 ,0 , -11" radius="15" /> 38 38 <SphereCollisionShape position="-0.8 ,0 , 0" radius="16" /> 39 < SphereCollisionShape position="0 ,0 , 11" radius="12.5" />39 <!-- <SphereCollisionShape position="0 ,0 , 11" radius="12.5" /> --> 40 40 </collisionShapes> 41 41 -
code/branches/FlappyOrx_HS17/data/overlays/FlappyOrxHUD.oxo
r11596 r11600 1 2 1 3 <Template name="FlappyOrxHUD"> 2 4 <OverlayGroup name="FlappyOrxHUD" scale = "1, 1"> -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
r11598 r11600 37 37 #include "core/command/Executor.h" 38 38 #include "core/config/ConfigValueIncludes.h" 39 39 #include "core/XMLPort.h" 40 40 #include "gamestates/GSLevel.h" 41 41 #include "chat/ChatManager.h" … … 63 63 bIsDead = true; 64 64 firstGame = true; //needed for the HUD 65 66 spawnDistance= 200; //distance between tubes65 speed = 0; 66 spawnDistance=300; //distance between tubes 67 67 tubeOffsetX=500; //tube offset (so that we can't see them spawn) 68 68 … … 70 70 setHUDTemplate("FlappyOrxHUD"); 71 71 } 72 72 73 void FlappyOrx::XMLPort(Element& xmlelement, XMLPort::Mode mode) 74 { 75 SUPER(FlappyOrx, XMLPort, xmlelement, mode); 76 XMLPortParam(FlappyOrx, "spawnDistance", setspawnDistance, getspawnDistance, xmlelement, mode); 77 XMLPortParam(FlappyOrx, "Speed", setSpeed, getSpeed, xmlelement, mode); 78 } 73 79 74 80 void FlappyOrx::updatePlayerPos(int x){ … … 95 101 void FlappyOrx::levelUp(){ 96 102 point++; 97 spawnDistance = 300-3*point; //smaller spawn Distance98 getPlayer()->setSpeed( 100+.5*point); //increase speed103 spawnDistance = spawnDistance-3*point; //smaller spawn Distance 104 getPlayer()->setSpeed(this->speed+.5*point); //increase speed 99 105 } 100 106 -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
r11598 r11600 67 67 virtual void death(); 68 68 virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command 69 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 70 71 void setspawnDistance( int spawnDistance) 72 {this->spawnDistance = spawnDistance; } 73 int getspawnDistance() 74 { return this->spawnDistance; } 75 inline void setSpeed( float speed ){ 76 orxout()<< speed<< endl; 77 this->speed = speed; } 78 inline float getSpeed( ) 79 { return this->speed; } 69 80 70 81 void updatePlayerPos(int x); … … 74 85 75 86 void setCenterpoint(FlappyOrxCenterPoint* center); 76 87 77 88 int getPoints(){return this->point;} 78 89 … … 92 103 int spawnDistance; 93 104 int tubeOffsetX; 105 float speed = 100; 94 106 95 107 private: -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc
r11596 r11600 58 58 } 59 59 60 61 60 void FlappyOrxShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) 62 61 { 63 62 SUPER(FlappyOrxShip, XMLPort, xmlelement, mode); 64 XMLPortParam(FlappyOrxShip, " speed", setSpeed, getSpeed, xmlelement, mode);63 XMLPortParam(FlappyOrxShip, "Speed", setSpeed, getSpeed, xmlelement, mode); 65 64 XMLPortParam(FlappyOrxShip, "UpwardThrust", setUpwardThrust, getUpwardThrust, xmlelement, mode); 66 XMLPortParam(FlappyOrxShip, " gravity", setGravity, getGravity, xmlelement, mode);65 XMLPortParam(FlappyOrxShip, "Gravity", setGravity, getGravity, xmlelement, mode); 67 66 } 68 67 … … 117 116 } 118 117 119 void FlappyOrxShip::updateLevel()120 {121 if (getGame())122 getGame()->levelUp();123 }124 125 118 int FlappyOrxShip::timeUntilRespawn(){ 126 119 return 2-time(0)+deathTime; … … 137 130 } 138 131 139 void FlappyOrxShip::rotateRoll(const Vector2& value)140 {141 if (getGame())142 if (getGame()->bEndGame)143 getGame()->end();144 }132 // void FlappyOrxShip::rotateRoll(const Vector2& value) 133 // { 134 // if (getGame()) 135 // if (getGame()->bEndGame) 136 // getGame()->end(); 137 // } 145 138 146 139 FlappyOrx* FlappyOrxShip::getGame() -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.h
r11595 r11600 49 49 virtual void tick(float dt) override; 50 50 51 // overwrite for 2d movement 52 virtual void moveFrontBack(const Vector2& value) override; 53 virtual void moveRightLeft(const Vector2& value) override; 54 51 55 52 // Starts or stops fireing 56 53 virtual void boost(bool bBoost) override; … … 60 57 virtual void rotatePitch(const Vector2& value) override{}; 61 58 //return to main menu if game has ended. 62 virtual void rotateRoll(const Vector2& value) override; 63 inline void setSpeed( float speed ) 64 { orxout() << "speed set: " << speed << endl; this->speed = speed; } 59 //virtual void rotateRoll(const Vector2& value) override; 60 61 inline void setSpeed( float speed ){ 62 orxout()<< speed<< endl; 63 this->speed = speed; } 65 64 inline float getSpeed( ) 66 65 { return this->speed; } … … 73 72 inline float getUpwardThrust() 74 73 { return this->UpwardThrust; } 75 virtual void updateLevel();74 76 75 virtual int timeUntilRespawn(); 77 76
Note: See TracChangeset
for help on using the changeset viewer.