Changeset 11418 for code/branches
- Timestamp:
- May 18, 2017, 1:24:43 PM (8 years ago)
- Location:
- code/branches/SuperOrxoBros_FS17
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/SuperOrxoBros_FS17/data/overlays/SOBHUD.oxo
r11412 r11418 80 80 81 81 <SOBHUDInfo 82 position = "0.5 ,0.5"82 position = "0.55,0.5" 83 83 pickpoint = "0.5, 0.5" 84 84 textposition = "0.5, 0.5" -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.cc
r11416 r11418 67 67 points_=0; 68 68 timeLeft_=400.0; 69 69 done_ = true; 70 70 lvl_ = 1; 71 71 … … 144 144 player->startControl(figure_); //Give the control of the instance player to the real person 145 145 players_[player].state_ = PlayerState::Alive; 146 done_ = false; 146 147 } 147 148 } … … 166 167 if (this->figure_ != nullptr && figure_->lvlEnded_) { 167 168 std::stringstream a; 168 a << "Nice! " << getPoints() << " Points .Press <Space> to restart";169 a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart"; 169 170 info_ =a.str(); 170 171 … … 179 180 this->figure_->dead_ = true; 180 181 //The time on the HUD 181 timeLeft_-=dt*2.5; 182 if (!done_) 183 timeLeft_-=dt*2.5; 182 184 } 183 185 -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOB.h
r11416 r11418 84 84 std::string getInfoText() { 85 85 return info_; 86 } 87 void setDone(bool tr) { 88 done_ = tr; 86 89 } 87 88 90 89 91 … … 100 102 } 101 103 102 103 104 WeakPtr<SOBCenterpoint> center_; 104 105 … … 112 113 int coins_; 113 114 float timeLeft_; 114 115 bool done_; 115 116 int lvl_; 116 117 std::string info_; -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.cc
r11416 r11418 45 45 #include "SOBFlagstone.h" 46 46 #include "SOBCastlestone.h" 47 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> 47 48 48 49 namespace orxonox … … 63 64 moveDownPressed_ = false; 64 65 firePressed_ = false; 65 66 collDisZ_ = 0; 66 67 //Times and turning 67 68 timeSinceLastFire_ = 0.0; … … 90 91 bool SOBFigure::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) { 91 92 93 //Inform tick fct that player is colliding and tell him how far away the collision point is from player middle point in z dir 92 94 isColliding_ = true; 95 collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ(); 96 93 97 94 98 //Orxocast returns object with casted type if otherObject has that class, and if not a nullptr … … 116 120 setVelocity(vel); 117 121 predead_=true; 122 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 123 SOBGame->setDone(true); 118 124 119 125 } else { … … 132 138 reachedLvlEndState_ = 1; 133 139 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 140 SOBGame->setDone(true); 134 141 SOBGame->addPoints(flagstone->getPoints()); 142 135 143 136 144 } … … 201 209 if (!predead_) 202 210 velocity.y = 0; 211 //If player falls in a hole 203 212 if (position.z < -100) { 204 213 dead_ = true; 214 SOB* SOBGame = orxonox_cast<SOB*>(getGametype()); 215 SOBGame->setDone(true); 205 216 } 206 217 … … 233 244 234 245 235 //If player hits space and does not move in z-dir236 if (inputAllowed && firePressed_ && isColliding_ && std::abs(velocity.z) < 0.1 && std::abs(lastSpeed_z) < 0.1) {246 //If player hits space and collides against an object under him then jump 247 if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 7.75 && collDisZ_ <+ 8.25)) { 237 248 gravityAcceleration_ = 100.0; 238 velocity.z = 110; //150249 velocity.z = 110; 239 250 } 240 251 … … 310 321 311 322 isColliding_ = false; 323 collDisZ_ = 0; 312 324 313 325 } -
code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBFigure.h
r11416 r11418 70 70 int reachedLvlEndState_; 71 71 float timeCounter_; 72 72 float collDisZ_; 73 73 74 74
Note: See TracChangeset
for help on using the changeset viewer.