- Timestamp:
- Dec 7, 2015, 2:32:47 PM (9 years ago)
- Location:
- code/branches/hoverHS15/src/modules/hover
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hoverHS15/src/modules/hover/Hover.cc
r10928 r10930 21 21 * 22 22 * Author: 23 * Florian Zinggeler23 * Manuel Meier 24 24 * Co-authors: 25 * ...25 * Cyrill Muskelprotz 26 26 * 27 27 */ … … 29 29 /** 30 30 @file Hover.cc 31 @brief Implementation of the Hover class. 31 @brief Implementation of the Hover class. Sets up the whole Minigame 32 32 */ 33 33 … … 51 51 { 52 52 bool firstTick = true; 53 54 //Levelcode represents the pitch: It's a 10x10 field. 55 // 1 represents a Wall on the right side of this square 56 // 2 represents a Wall on the top of this square 57 // 3 represents 2 and 1 at the same time 58 // Note: the levelcode is generated from the Maze-Generator functions at the beginning of the game 53 59 int levelcode[10][10] = 54 60 { … … 122 128 g_PtY=0; 123 129 GenerateMaze(); 124 MazeOut();125 130 RenderMaze(); 126 LevelOut();127 131 firstTick = false; 128 132 … … 135 139 } 136 140 141 //Generate inner Walls according to levelcode 137 142 for(int y=0; y<10; y++){ 138 143 for(int x=0; x<10; x++){ … … 150 155 } 151 156 152 157 //Generate 5 flags randomly 153 158 for ( int i = 0; i < 5; i++ ) 154 159 flagVector.push_back(new HoverFlag(origin_->getContext(), rand()%10, rand()%10)); 155 160 156 161 Flags_ = flagVector.size(); 157 158 //new HoverFlag(origin_->getContext()); //Rechts in Y Richtung 159 //new HoverWall(origin_->getContext(), 5, 6, 0); //Ueber in x richtung 160 //new HoverWall(origin_->getContext(), 5, 5, 0); //Ueber in x richtung 161 } 162 163 }//firsttick end 164 165 // Check if ship collided with one of the flags 162 166 for ( int i = 0; i < flagVector.size(); i++ ){ 163 167 if(flagVector[i]->getCollided()){ … … 200 204 201 205 202 //////////////////////////////////////////////////////////////////////////// 203 206 // Some definitions for the Maze-Generator 204 207 205 208 // 0 1 2 3 4 5 6 7 8 … … 220 223 221 224 222 //////////////////////////////////////////////////////////////////////////// 223 225 /** 226 @brief 227 Checks if Direction is valid (for Maze-Generator) 228 */ 224 229 bool Hover::IsDirValid( eDirection Dir ) 225 230 { … … 232 237 } 233 238 239 /** 240 @brief 241 Generates new Direction (for Maze-Generator) 242 */ 234 243 eDirection Hover::GetDirection() 235 244 { … … 259 268 } 260 269 270 /** 271 @brief 272 Generates a Maze (for Maze-Generator) 273 */ 261 274 void Hover::GenerateMaze() 262 275 { … … 265 278 for ( eDirection Dir = GetDirection(); Dir != eDirection_Invalid; Dir = GetDirection() ) 266 279 { 267 // a progress indicator, kind of268 // if ( ++Cells % 1000 == 0 ) std::cout << ".";269 270 280 g_Maze[ CellIdx() ] |= Dir; 271 281 … … 275 285 g_Maze[ CellIdx() ] = Mask[ Dir ]; 276 286 } 277 278 std::cout << std::endl;279 287 } 280 288 281 289 /** 290 @brief 291 Print Maze (for Debugging only) 292 */ 282 293 void Hover::MazeOut(){ 283 294 for ( int y = 0; y < NumCells; y++ ) … … 302 313 } 303 314 315 /** 316 @brief 317 Print Levelcode (for Debugging only) 318 */ 304 319 void Hover::LevelOut(){ 305 320 for ( int y = 0; y < NumCells; y++ ) … … 307 322 for ( int x = 0; x < NumCells; x++ ) 308 323 { 309 /*orxout()<<"[";324 orxout()<<"["; 310 325 if ( levelcode[x][y] < 2) orxout()<<"U"; 311 326 else orxout()<<" "; … … 315 330 orxout()<<" "; 316 331 orxout()<<" "; 317 orxout()<<"]";*/ 318 319 orxout()<<levelcode[x][y]; 332 orxout()<<"]"; 320 333 } 321 334 orxout()<<endl; 322 335 } 323 324 325 326 } 327 336 } 337 338 /** 339 @brief 340 Generate Levelcode from Maze 341 */ 328 342 void Hover::RenderMaze() 329 343 { … … 336 350 if ( !( v & eDirection_Up ) && y >0) levelcode[y][x] |= 2; 337 351 if ( !( v & eDirection_Right ) && x <9) levelcode[y][x] |= 1; 338 //if ( !( v & eDirection_Down ) && y>0) levelcode[x][y-1] += 2;339 //if ( !( v & eDirection_Left ) && x>0) levelcode[x-1][y] += 1;340 352 } 341 353 } -
code/branches/hoverHS15/src/modules/hover/Hover.h
r10900 r10930 20 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 21 * 22 * Author:23 * Florian Zinggeler22 * Master of Desaster: 23 * Manuel Meier 24 24 * Co-authors: 25 * ...25 * Cyrill Muskelprotz 26 26 * 27 27 */ … … 29 29 /** 30 30 @file Hover.h 31 @brief Gametype. 31 @brief Gametype. For more information see .cc file 32 32 @ingroup Hover 33 33 */ … … 37 37 38 38 #include "HoverPrereqs.h" 39 #include "HoverOrigin.h" // Necessary for WeakPointer 40 //#include "HoverShip.h" DO NOT include in Header. Will cause forward declaration issues 41 42 //#include "HoverHUDinfo.h" 39 #include "HoverOrigin.h" 43 40 44 41 #include "gametypes/Gametype.h" … … 80 77 virtual void end(); 81 78 82 virtual void tick(float dt); 83 84 // void setOrigin(HoverOrigin* center) 85 // { center_ = center; } 79 virtual void tick(float dt); 86 80 87 81 void setOrigin(HoverOrigin* origin) -
code/branches/hoverHS15/src/modules/hover/HoverFlag.cc
r10928 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... … … 29 29 /** 30 30 @file HoverFlag.cc 31 @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.31 @brief The Flags that are being set in the Hover Minigame They support two coordinates from 0-9 each 32 32 */ 33 33 … … 56 56 } 57 57 58 /** 59 @brief 60 Constructor that expects two coordinate-values in the range 0-9 61 @param xCoordinate 62 X-Coordinate of the flage, 0-9, origin is bottom left 63 @param yCoordinate 64 Y-Coordinate of the flage, 0-9, origin is bottom left 65 */ 58 66 HoverFlag::HoverFlag(Context* context, int xCoordinate, int yCoordinate) : StaticEntity(context) 59 67 { … … 92 100 } 93 101 94 //xml port for loading height and width of the platform102 //xml port unused 95 103 void HoverFlag::XMLPort(Element& xmlelement, XMLPort::Mode mode) 96 104 { … … 104 112 @brief 105 113 Is called every tick. 106 Handles the movement of the ball and its interaction with the boundaries and bats.107 114 @param dt 108 115 The time since the last tick. … … 114 121 } 115 122 123 /** 124 @brief 125 Checks if the Hovership collided with the flag 126 */ 116 127 bool HoverFlag::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) 117 128 { -
code/branches/hoverHS15/src/modules/hover/HoverFlag.h
r10894 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... … … 29 29 /** 30 30 @file HoverFlag.h 31 @brief Declaration of the HoverFlag class.32 @ingroup Jump31 @brief See .cc File 32 @ingroup Hover 33 33 */ 34 34 -
code/branches/hoverHS15/src/modules/hover/HoverOrigin.cc
r10751 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... -
code/branches/hoverHS15/src/modules/hover/HoverOrigin.h
r10751 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... -
code/branches/hoverHS15/src/modules/hover/HoverWall.cc
r10926 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... … … 29 29 /** 30 30 @file HoverWall.cc 31 @brief All platforms in this minigame inherit from this class. The basic functions of a platform (interact with figure) is implemented here. Special functions are implemented in the specialized classes.31 @brief Represents one Wall piece in the Hover Game 32 32 */ 33 33 … … 54 54 } 55 55 56 57 /** 58 @brief 59 Constructor of a HoverWall 60 @param x 61 x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left 62 @param y 63 y-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left 64 @param orientation 65 Wall on the right side (1) or on top (2) of this square, 0-1 66 */ 56 67 HoverWall::HoverWall(Context* context, int x, int y, int orientation) : StaticEntity(context) 57 68 { … … 101 112 } 102 113 103 //xml port for loading height and width of the platform 114 //xml port for loading height and width of the platform, unused 104 115 void HoverWall::XMLPort(Element& xmlelement, XMLPort::Mode mode) 105 116 { 106 117 SUPER(HoverWall, XMLPort, xmlelement, mode); 107 108 // XMLPortParam(HoverWall, "height", setHeight, getHeight, xmlelement, mode);109 //XMLPortParam(HoverWall, "width", setWidth, getWidth, xmlelement, mode);110 118 } 111 119 -
code/branches/hoverHS15/src/modules/hover/HoverWall.h
r10785 r10930 21 21 * 22 22 * Author: 23 * Fabien Vultier23 * Manuel Meier 24 24 * Co-authors: 25 25 * ... … … 29 29 /** 30 30 @file HoverWall.h 31 @brief Declaration of the HoverWall class.32 @ingroup Jump31 @brief See .cc-file for further information 32 @ingroup Hover 33 33 */ 34 34
Note: See TracChangeset
for help on using the changeset viewer.