Changeset 11151 for code/branches/tgidronFS16/src/modules/hover
- Timestamp:
- Mar 24, 2016, 3:53:28 PM (9 years ago)
- Location:
- code/branches/tgidronFS16/src/modules/hover
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tgidronFS16/src/modules/hover/FlagHUD.cc
r11071 r11151 54 54 this->overlay_->add2D(this->panel_); 55 55 56 this->flagCount_ = 5;57 setFlagCount( 5);56 this->flagCount_ = 1; 57 setFlagCount(1); 58 58 } 59 59 -
code/branches/tgidronFS16/src/modules/hover/Hover.cc
r11071 r11151 33 33 34 34 #include "Hover.h" 35 35 #include "chat/ChatManager.h" 36 36 #include "HoverOrigin.h" 37 37 #include "HoverWall.h" … … 39 39 #include "MazeGenerator.h" 40 40 #include "core/CoreIncludes.h" 41 #include "gamestates/GSLevel.h" 41 42 42 43 namespace orxonox … … 51 52 this->numberOfFlags_ = 1; 52 53 this->firstTick_ = true; 54 level = 1; //start at level 1 55 flagsTaken = 0;// took 0 flags in the beginning 56 57 numCells = 0; 58 cellSize = 0; 59 cellHeight = 0; 53 60 54 61 this->setHUDTemplate("HoverHUD"); 62 63 55 64 } 56 65 57 void Hover:: tick(float dt)66 void Hover::start() 58 67 { 59 SUPER(Hover, tick, dt); 60 68 Gametype::start(); 61 69 if(this->firstTick_ && this->origin_) 62 70 { 63 71 this->firstTick_ = false; 64 72 65 intnumCells = this->origin_->getNumCells();66 intcellSize = this->origin_->getCellSize();67 intcellHeight = this->origin_->getCellHeight();73 numCells = this->origin_->getNumCells(); 74 cellSize = this->origin_->getCellSize(); 75 cellHeight = this->origin_->getCellHeight(); 68 76 69 77 MazeGenerator generator(numCells); … … 94 102 } 95 103 96 //Generate 5 flags randomly 97 for ( int i = 0; i < 5; i++ )104 //Generate 5 flags randomly (test only 1 flag) 105 for ( int i = 0; i < 1; i++ ) 98 106 { 99 107 HoverFlag* flag = new HoverFlag(origin_->getContext()); … … 102 110 } 103 111 104 }//firsttick end 112 } 113 } 114 115 116 117 void Hover::startLevel(){ 118 //Generate 5 flags randomly (test only 1 flag) 119 for ( int i = 0; i < 1; i++ ) 120 { 121 HoverFlag* flag = new HoverFlag(origin_->getContext()); 122 flag->init(rand()%numCells, rand()%numCells, cellSize); 123 flags_.push_back(flag); 124 } 125 126 } 127 128 void Hover::tick(float dt) 129 { 130 SUPER(Hover, tick, dt); 131 105 132 106 133 // Check if ship collided with one of the flags … … 109 136 flags_[i]->destroyLater(); 110 137 flags_.erase (flags_.begin()+i); 138 if(flags_.size()<=0){ 139 ChatManager::message("Level Up!"); 140 141 levelUp(); 142 //GSLevel::startMainMenu(); 143 } 111 144 } 145 112 146 } 113 147 numberOfFlags_ = flags_.size(); 114 148 } 149 150 void Hover::levelUp() 151 { 152 level++; 153 startLevel(); 154 155 } 115 156 } -
code/branches/tgidronFS16/src/modules/hover/Hover.h
r11071 r11151 55 55 { this->origin_ = origin; } 56 56 57 void start(); 58 void startLevel(); 59 void levelUp(); 60 void endLevel(); 61 62 57 63 inline int getNumberOfFlags() const 58 64 { return this->numberOfFlags_; } … … 63 69 int numberOfFlags_; 64 70 bool firstTick_; 71 int level; 72 int lives; 73 int flagsTaken; 74 75 int cellSize; 76 int cellHeight; 77 int numCells; 65 78 }; 66 79 } -
code/branches/tgidronFS16/src/modules/hover/HoverShip.cc
r11041 r11151 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" 35 //#include "NewHumanController.h" 35 36 36 37 #include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h> … … 112 113 if (bBoost && this->isFloor_) 113 114 { 115 114 116 this->setVelocity( 115 117 this->getVelocity().x,
Note: See TracChangeset
for help on using the changeset viewer.