Changeset 11909 for code/branches/Hover_FS18/src/modules
- Timestamp:
- Apr 26, 2018, 3:50:24 PM (7 years ago)
- Location:
- code/branches/Hover_FS18/src/modules/hover
- Files:
-
- 4 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Hover_FS18/src/modules/hover/CMakeLists.txt
r11495 r11909 2 2 Hover.cc 3 3 HoverShip.cc 4 HoverWall.cc5 4 HoverOrigin.cc 6 5 HoverFlag.cc 7 6 TimeHUD.cc 8 7 FlagHUD.cc 9 MazeGenerator.cc10 8 ) 11 9 -
code/branches/Hover_FS18/src/modules/hover/Hover.cc
r11495 r11909 35 35 36 36 #include "HoverOrigin.h" 37 #include "HoverWall.h"38 37 #include "HoverFlag.h" 39 #include "MazeGenerator.h"40 38 #include "core/CoreIncludes.h" 41 39 … … 59 57 SUPER(Hover, tick, dt); 60 58 61 if(this->firstTick_ && this->origin_)59 /*if(this->firstTick_ && this->origin_) 62 60 { 63 61 this->firstTick_ = false; 64 65 int numCells = this->origin_->getNumCells();66 int cellSize = this->origin_->getCellSize();67 int cellHeight = this->origin_->getCellHeight();68 69 MazeGenerator generator(numCells);70 generator.generateMaze();71 generator.renderMaze();72 73 int* levelcode = generator.getLevelcode();74 75 //Outer Walls76 for(int i = 0; i<numCells; i++){77 (new HoverWall(origin_->getContext()))->init(0, i+1, cellSize, cellHeight, 1);78 (new HoverWall(origin_->getContext()))->init(numCells, i+1, cellSize, cellHeight, 1);79 (new HoverWall(origin_->getContext()))->init(i+1, 0, cellSize, cellHeight, 2);80 (new HoverWall(origin_->getContext()))->init(i+1, numCells, cellSize, cellHeight, 2);81 }82 83 //Generate inner Walls according to levelcode84 for(int y=0; y<numCells; y++){85 for(int x=0; x<numCells; x++){86 switch(levelcode[ y * numCells + x ]){87 case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);88 break;89 case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);90 case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);91 default: break;92 }93 }94 }95 62 96 63 //Generate 5 flags randomly … … 102 69 } 103 70 104 }//firsttick end 71 }//firsttick end*/ 105 72 106 73 // Check if ship collided with one of the flags 107 for ( unsigned int i = 0; i < flags_.size(); i++ ){74 /*for ( unsigned int i = 0; i < flags_.size(); i++ ){ 108 75 if(flags_[i]->getCollided()){ 109 76 flags_[i]->destroyLater(); … … 111 78 } 112 79 } 113 numberOfFlags_ = flags_.size(); 80 numberOfFlags_ = flags_.size();*/ 114 81 } 115 82 }
Note: See TracChangeset
for help on using the changeset viewer.