Changeset 10184
- Timestamp:
- Dec 17, 2014, 3:43:07 PM (10 years ago)
- Location:
- code/branches/pickupsFS14
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/data/levels/emptyLevel.oxw
r9415 r10184 24 24 <?lua include("includes/notifications.oxi") ?> 25 25 26 <NotificationQueueCEGUI 27 name="narrative" 28 targets="simpleNotification" 29 size=3 30 displayTime=3.9 31 position="0.2, 0, 0.1, 0" 32 fontSize="23" 33 fontColor="0.3, 1, 0.2, 0.8" 34 alignment="HorzCentred" 35 displaySize="0.6, 0, 0, 0" 36 /> 26 37 <Scene 27 38 ambientlight = "0.8, 0.8, 0.8" … … 31 42 <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"/> 32 43 <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> 44 45 <Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 4" > 46 <events> 47 <visibility> 48 <EventListener event="flying4" /> 49 </visibility> 50 </events> 51 <attached> 52 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 53 </attached> 54 <collisionShapes> 55 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 56 </collisionShapes> 57 <controller> 58 <WaypointController team=1> 59 </WaypointController> 60 </controller> 61 </Pawn> 62 63 64 65 <SimpleNotification message="Right click on the next target." broadcast="true"> 66 <events> 67 <trigger> 68 <EventListener event="box" /> 69 </trigger> 70 </events> 71 </SimpleNotification> 33 72 34 73 </Scene> -
code/branches/pickupsFS14/data/levels/jump.oxw
r10112 r10184 243 243 <Model position="0,0,-1000" mesh="JumpPlatform06.mesh" scale="1" /> 244 244 <Model position="0,0,-1000" mesh="JumpProjectile.mesh" scale="1" /> 245 <Model position="0,0,-1000" mesh="JumpFigure.mesh" scale="1" />246 245 <Model position="0,0,-1000" mesh="JumpEnemy1.mesh" scale="1" /> 247 246 <Model position="0,0,-1000" mesh="JumpEnemy2.mesh" scale="1" /> … … 250 249 <Model position="0,0,-1000" mesh="JumpSpring.mesh" scale="1" /> 251 250 <Model position="0,0,-1000" mesh="JumpRocket.mesh" scale="1" /> 251 <Model position="0,0,-1000" mesh="JumpPropeller.mesh" scale="1" /> 252 <Model position="0,0,-1000" mesh="JumpBoots.mesh" scale="1" /> 253 <Model position="0,0,-1000" mesh="JumpShield.mesh" scale="1" /> 252 254 </attached> 253 255 </JumpCenterpoint> -
code/branches/pickupsFS14/data/overlays/jumpHUD.oxo
r10074 r10184 1 1 <Template name="JumpHUD"> 2 2 <OverlayGroup name="JumpHUD" scale = "1, 1"> 3 3 4 <JumpScore 4 5 position = "0.5, 0.05" … … 9 10 align = "center" 10 11 showScore = true 12 showFuel = false 11 13 showMessages = false 12 14 /> 15 16 <JumpScore 17 position = "0.1, 0.05" 18 pickpoint = "0.0, 0.0" 19 font = "ShareTechMono" 20 textsize = 0.05 21 colour = "1.0, 0.5, 0.0, 1.0" 22 align = "left" 23 showScore = false 24 showFuel = true 25 showMessages = false 26 /> 13 27 14 28 <JumpScore … … 21 35 gameOverText = "GAME OVER" 22 36 showScore = false 37 showFuel = false 23 38 showMessages = true 24 /> 39 /> 40 41 <HUDBar 42 name = "SpeedBar1" 43 background = "Orxonox/BarBackground" 44 size = "0.35, 0.05" 45 position = "0.0 , 1.0 " 46 pickpoint = "0, 1" 47 correctaspect = false 48 49 initialvalue = 50 50 51 > 52 <BarColour position = 0.0 colour = "0.7,0.5,0.2" /> 53 <BarColour position = 0.5 colour = "0.2,0.7,0.2" /> 54 <BarColour position = 1.0 colour = "0.7,0.2,0.2" /> 55 </HUDBar> 25 56 26 57 </OverlayGroup> -
code/branches/pickupsFS14/src/modules/jump/Jump.cc
r10111 r10184 1271 1271 } 1272 1272 1273 float Jump::getFuel() const 1274 { 1275 if (this->figure_ != NULL) 1276 { 1277 if (this->figure_->rocketActive_ != NULL) 1278 { 1279 return this->figure_->rocketActive_->getFuelState(); 1280 } 1281 else if (this->figure_->propellerActive_ != NULL) 1282 { 1283 return this->figure_->propellerActive_->getFuelState(); 1284 } 1285 else if (this->figure_->shieldActive_ != NULL) 1286 { 1287 return this->figure_->shieldActive_->getFuelState(); 1288 } 1289 else if (this->figure_->bootsActive_ != NULL) 1290 { 1291 return this->figure_->bootsActive_->getFuelState(); 1292 } 1293 } 1294 1295 return 0.0; 1296 } 1297 1273 1298 bool Jump::getDead(PlayerInfo* player) const 1274 1299 { -
code/branches/pickupsFS14/src/modules/jump/Jump.h
r10111 r10184 21 21 * 22 22 * Author: 23 * Fabi an 'x3n' Landau23 * Fabien Vultier 24 24 * Co-authors: 25 25 * ... … … 49 49 virtual void spawnPlayer(PlayerInfo* player); 50 50 int getScore(PlayerInfo* player) const; 51 float getFuel() const; 51 52 bool getDead(PlayerInfo* player) const; 52 53 void setCenterpoint(JumpCenterpoint* center) -
code/branches/pickupsFS14/src/modules/jump/JumpBoots.cc
r10111 r10184 52 52 RegisterObject(JumpBoots); 53 53 54 fuel_ = 3.0; 54 initialFuel_ = 3.0; 55 fuel_ = initialFuel_; 55 56 attachedToFigure_ = false; 56 57 … … 102 103 attachedToFigure_ = figure_->StartBoots(this); 103 104 } 105 106 float JumpBoots::getFuelState() 107 { 108 return fuel_/initialFuel_; 109 } 104 110 } -
code/branches/pickupsFS14/src/modules/jump/JumpBoots.h
r10111 r10184 45 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 46 virtual void touchFigure(); 47 virtual float getFuelState(); 47 48 protected: 48 49 float stretch_; 49 50 float fuel_; 51 float initialFuel_; 50 52 }; 51 53 } -
code/branches/pickupsFS14/src/modules/jump/JumpFigure.cc
r10111 r10184 70 70 animateHands_ = false; 71 71 turnUp_ = false; 72 rocketActive_ = false;73 propellerActive_ = false;74 bootsActive_ = false;75 shieldActive_ = false;72 rocketActive_ = NULL; 73 propellerActive_ = NULL; 74 bootsActive_ = NULL; 75 shieldActive_ = NULL; 76 76 rocketSpeed_ = 0.0; 77 77 propellerSpeed_ = 0.0; … … 106 106 // Move up/down 107 107 Vector3 velocity = getVelocity(); 108 if (rocketActive_ == true)108 if (rocketActive_ != NULL) 109 109 { 110 110 velocity.z = rocketSpeed_; 111 111 } 112 else if (propellerActive_ == true)112 else if (propellerActive_ != NULL) 113 113 { 114 114 velocity.z = propellerSpeed_; … … 207 207 { 208 208 Vector3 velocity = getVelocity(); 209 velocity.z = (bootsActive_ ? 1.2*jumpSpeed_ : jumpSpeed_); 209 if (bootsActive_ == NULL) 210 { 211 velocity.z = 1.2*jumpSpeed_; 212 } 213 else 214 { 215 velocity.z = jumpSpeed_; 216 } 210 217 setVelocity(velocity); 211 212 218 animateHands_ = true; 213 219 handAngle_ = 0.0; … … 228 234 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 229 235 { 230 if (rocketActive_ == false && propellerActive_ == false && shieldActive_ == false)236 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL) 231 237 { 232 238 dead_ = true; … … 236 242 bool JumpFigure::StartRocket(JumpRocket* rocket) 237 243 { 238 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)244 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 239 245 { 240 246 attach(rocket); 241 247 rocket->setPosition(0.0, rocketPos_, 0.0); 242 248 rocket->setVelocity(0.0, 0.0, 0.0); 243 rocketActive_ = true;249 rocketActive_ = rocket; 244 250 245 251 return true; … … 255 261 detach(rocket); 256 262 rocket->destroy(); 257 rocketActive_ = false;263 rocketActive_ = NULL; 258 264 } 259 265 260 266 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 261 267 { 262 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)268 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 263 269 { 264 270 attach(propeller); 265 271 propeller->setPosition(0.0, 0.0, propellerPos_); 266 272 propeller->setVelocity(0.0, 0.0, 0.0); 267 propellerActive_ = true;273 propellerActive_ = propeller; 268 274 269 275 return true; … … 279 285 detach(propeller); 280 286 propeller->destroy(); 281 propellerActive_ = false;287 propellerActive_ = NULL; 282 288 } 283 289 284 290 bool JumpFigure::StartBoots(JumpBoots* boots) 285 291 { 286 if (rocketActive_ == false && propellerActive_ == false && bootsActive_ == false)292 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL) 287 293 { 288 294 attach(boots); 289 295 boots->setPosition(0.0, 0.0, bootsPos_); 290 296 boots->setVelocity(0.0, 0.0, 0.0); 291 bootsActive_ = true;297 bootsActive_ = boots; 292 298 293 299 return true; … … 303 309 detach(boots); 304 310 boots->destroy(); 305 bootsActive_ = false;311 bootsActive_ = NULL; 306 312 } 307 313 … … 313 319 shield->setPosition(0.0, 0.0, propellerPos_); 314 320 shield->setVelocity(0.0, 0.0, 0.0); 315 shieldActive_ = true;321 shieldActive_ = shield; 316 322 317 323 return true; … … 327 333 detach(shield); 328 334 shield->destroy(); 329 shieldActive_ = false;335 shieldActive_ = NULL; 330 336 } 331 337 -
code/branches/pickupsFS14/src/modules/jump/JumpFigure.h
r10111 r10184 31 31 32 32 #include "jump/JumpPrereqs.h" 33 34 33 #include "worldentities/ControllableEntity.h" 35 34 … … 119 118 120 119 bool fireSignal_; 121 bool rocketActive_;122 bool propellerActive_;123 120 bool dead_; 121 122 JumpRocket* rocketActive_; 123 JumpPropeller* propellerActive_; 124 JumpBoots* bootsActive_; 125 JumpShield* shieldActive_; 124 126 private: 125 127 std::string modelLeftHand_; … … 149 151 bool animateHands_; 150 152 bool turnUp_; 151 bool bootsActive_;152 bool shieldActive_;153 153 float rocketSpeed_; 154 154 float propellerSpeed_; -
code/branches/pickupsFS14/src/modules/jump/JumpItem.h
r10111 r10184 53 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 54 54 virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed); 55 virtual void setFigure(WeakPtr<JumpFigure> bats); //!< Set the bats for the ball.55 virtual void setFigure(WeakPtr<JumpFigure> bats); 56 56 virtual void touchFigure(); 57 57 … … 74 74 75 75 protected: 76 float fieldWidth_; //!< The width of the playing field.77 float fieldHeight_; //!< The height of the playing field.78 WeakPtr<JumpFigure> figure_; //!< An array with the two bats.76 float fieldWidth_; 77 float fieldHeight_; 78 WeakPtr<JumpFigure> figure_; 79 79 float height_; 80 80 float width_; -
code/branches/pickupsFS14/src/modules/jump/JumpPropeller.cc
r10111 r10184 52 52 RegisterObject(JumpPropeller); 53 53 54 fuel_ = 3.0; 54 initialFuel_ = 3.0; 55 fuel_ = initialFuel_; 55 56 attachedToFigure_ = false; 56 57 … … 106 107 } 107 108 } 109 110 float JumpPropeller::getFuelState() 111 { 112 return fuel_/initialFuel_; 113 } 108 114 } -
code/branches/pickupsFS14/src/modules/jump/JumpPropeller.h
r10111 r10184 47 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 48 virtual void touchFigure(); 49 virtual float getFuelState(); 49 50 protected: 50 51 float stretch_; 51 52 float fuel_; 53 float initialFuel_; 52 54 }; 53 55 } -
code/branches/pickupsFS14/src/modules/jump/JumpRocket.cc
r10111 r10184 49 49 RegisterObject(JumpRocket); 50 50 51 fuel_ = 3.0; 51 initialFuel_ = 3.0; 52 fuel_ = initialFuel_; 52 53 attachedToFigure_ = false; 53 54 … … 99 100 attachedToFigure_ = figure_->StartRocket(this); 100 101 } 102 103 float JumpRocket::getFuelState() 104 { 105 return fuel_/initialFuel_; 106 } 101 107 } -
code/branches/pickupsFS14/src/modules/jump/JumpRocket.h
r10111 r10184 44 44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 45 45 virtual void touchFigure(); 46 virtual float getFuelState(); 46 47 protected: 47 48 float stretch_; 48 49 float fuel_; 50 float initialFuel_; 49 51 }; 50 52 } -
code/branches/pickupsFS14/src/modules/jump/JumpScore.cc
r10111 r10184 50 50 owner_ = NULL; 51 51 showScore_ = false; 52 showFuel_ = false; 52 53 showMessages_ = false; 53 54 } … … 63 64 64 65 XMLPortParam(JumpScore, "showScore", setShowScore, getShowScore, xmlelement, mode); 66 XMLPortParam(JumpScore, "showFuel", setShowFuel, getShowFuel, xmlelement, mode); 65 67 XMLPortParam(JumpScore, "showMessages", setShowMessages, getShowMessages, xmlelement, mode); 66 68 XMLPortParam(JumpScore, "gameOverText", setGameOverText, getGameOverText, xmlelement, mode); … … 86 88 setCaption(str); 87 89 } 90 else if (showFuel_ == true) 91 { 92 float fuel = owner_->getFuel(); 93 orxout() << fuel << endl; 94 std::string str; 95 96 if (fuel <= 0.0) 97 { 98 str = ""; 99 } 100 else 101 { 102 str = multi_cast<std::string>(fuel); 103 } 104 setCaption(str); 105 } 88 106 else if (showMessages_ == true) 89 107 { 90 91 108 setCaption(owner_->getDead(player_) == true ? gameOverText_ : ""); 92 109 } -
code/branches/pickupsFS14/src/modules/jump/JumpScore.h
r10111 r10184 54 54 { return showScore_; } 55 55 56 void setShowFuel(const bool showFuel) 57 { showFuel_ = showFuel; } 58 59 const bool getShowFuel() const 60 { return showFuel_; } 61 56 62 void setShowMessages(const bool showMessages) 57 63 { showMessages_ = showMessages; } 58 64 59 65 const bool getShowMessages() const 60 { return showMessages_; } 66 { return showMessages_; } 61 67 62 68 void setGameOverText(const std::string& gameOverText) … … 71 77 WorldSound* scoreSound_; 72 78 bool showScore_; 79 bool showFuel_; 73 80 bool showMessages_; 74 81 std::string gameOverText_; -
code/branches/pickupsFS14/src/modules/jump/JumpShield.cc
r10111 r10184 52 52 RegisterObject(JumpShield); 53 53 54 fuel_ = 7.0; 54 initialFuel_ = 7.0; 55 fuel_ = initialFuel_; 55 56 attachedToFigure_ = false; 56 57 … … 102 103 attachedToFigure_ = figure_->StartShield(this); 103 104 } 105 106 float JumpShield::getFuelState() 107 { 108 return fuel_/initialFuel_; 109 } 104 110 } -
code/branches/pickupsFS14/src/modules/jump/JumpShield.h
r10111 r10184 47 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 48 virtual void touchFigure(); 49 virtual float getFuelState(); 49 50 protected: 50 51 float stretch_; 51 52 float fuel_; 53 float initialFuel_; 52 54 }; 53 55 }
Note: See TracChangeset
for help on using the changeset viewer.