Changeset 12062 for code/branches
- Timestamp:
- Oct 31, 2018, 10:56:46 AM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/data/levels/OrxoKart1.oxw
r12057 r12062 26 26 N = 11 27 27 --scaling factor 28 S = 250 28 S = 150 29 -- Map Matrix 30 MAP = "1,0,1,01,10,10,10,10,1,101,1,0101,010,10,10,10,10,10,10,10,1010,10,0,10,10,10,10,00,1,01,0110,11,01,01,10,1,1,1,10,1,10" 29 31 30 32 MAP_ORIGIN = "0,0,0" … … 49 51 <attached> 50 52 <!-- Walls and flags (physics and design)--> 51 <!-- 53 <!-- 52 54 <HoverOrigin 53 numCells="<?lua print( MAZE_NUM_CELLS)?>"54 cellSize="<?lua print( MAZE_CELL_SIZE)?>"55 numCells="<?lua print(N)?>" 56 cellSize="<?lua print(S)?>" 55 57 cellHeight="<?lua print(MAZE_CELL_HEIGHT)?>" 56 58 /> … … 58 60 59 61 <!-- floor design --> 60 61 62 63 64 65 66 62 67 63 <Model -
code/branches/OrxoKart_HS18/src/modules/hover/Hover.cc
r11495 r12062 70 70 generator.generateMaze(); 71 71 generator.renderMaze(); 72 int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0 73 ,1,0,0,0,0,0,0,1,1,1,0 74 ,1,0,1,1,1,1,0,0,0,1,1 75 ,1,1,1,0,0,1,1,0,0,0,1 76 ,0,0,0,0,0,0,1,0,1,1,1 77 ,1,1,1,1,1,1,1,0,1,0,0 78 ,1,0,0,0,0,0,0,0,1,0,0 79 ,1,0,0,0,0,0,0,0,1,0,0 80 ,1,1,1,1,1,0,0,0,1,1,1 81 ,0,0,0,0,1,0,0,0,0,0,1 82 ,0,0,0,0,1,1,1,1,1,1,1}; 83 //int* levelcode = generator.getLevelcode(); 84 int* levelcode = levelcodeArray; 72 85 73 int* levelcode = generator.getLevelcode();74 86 75 87 //Outer Walls … … 87 99 case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1); 88 100 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);101 //case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1); 102 //case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0); 91 103 default: break; 92 104 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
r12057 r12062 35 35 36 36 #include "OrxoKartOrigin.h" 37 #include "OrxoKart Wall.h"37 #include "OrxoKartTile.h" 38 38 #include "core/CoreIncludes.h" 39 39 … … 50 50 this->firstTick_ = true; 51 51 52 this-> setHUDTemplate("HoverHUD");52 this->nullptr 53 53 } 54 54 55 55 void OrxoKart::tick(float dt) 56 { /*56 { 57 57 SUPER(OrxoKart, tick, dt); 58 58 … … 68 68 generator.generateMaze(); 69 69 generator.renderMaze(); 70 71 int* levelcode = generator.getLevelcode(); 70 int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0 71 ,1,0,0,0,0,0,0,1,1,1,0 72 ,1,0,1,1,1,1,0,0,0,1,1 73 ,1,1,1,0,0,1,1,0,0,0,1 74 ,0,0,0,0,0,0,1,0,1,1,1 75 ,1,1,1,1,1,1,1,0,1,0,0 76 ,1,0,0,0,0,0,0,0,1,0,0 77 ,1,0,0,0,0,0,0,0,1,0,0 78 ,1,1,1,1,1,0,0,0,1,1,1 79 ,0,0,0,0,1,0,0,0,0,0,1 80 ,0,0,0,0,1,1,1,1,1,1,1}; 81 //int* levelcode = generator.getLevelcode(); 82 int* levelcode = levelcodeArray; 72 83 73 84 //Outer Walls 74 85 for(int i = 0; i<numCells; i++){ 75 (new HoverWall(origin_->getContext()))->init(0, i+1, cellSize, cellHeight, 1);76 (new HoverWall(origin_->getContext()))->init(numCells, i+1, cellSize, cellHeight, 1);77 (new HoverWall(origin_->getContext()))->init(i+1, 0, cellSize, cellHeight, 2);78 (new HoverWall(origin_->getContext()))->init(i+1, numCells, cellSize, cellHeight, 2);86 (new OrxoKartTile(origin_->getContext()))->init(0, i+1, cellSize, cellHeight, 1); 87 (new OrxoKartTile(origin_->getContext()))->init(numCells, i+1, cellSize, cellHeight, 1); 88 (new OrxoKartTile(origin_->getContext()))->init(i+1, 0, cellSize, cellHeight, 2); 89 (new OrxoKartTile(origin_->getContext()))->init(i+1, numCells, cellSize, cellHeight, 2); 79 90 } 80 91 … … 83 94 for(int x=0; x<numCells; x++){ 84 95 switch(levelcode[ y * numCells + x ]){ 85 case 1: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);96 case 1: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1); 86 97 break; 87 case 3: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1);88 case 2: (new HoverWall(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0);98 case 3: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 1); 99 case 2: (new OrxoKartTile(origin_->getContext()))->init(x+1, numCells-y, cellSize, cellHeight, 0); 89 100 default: break; 90 101 } … … 92 103 } 93 104 94 //Generate 5 flags randomly 95 for ( int i = 0; i < 5; i++ ) 96 { 97 HoverFlag* flag = new HoverFlag(origin_->getContext()); 98 flag->init(rand()%numCells, rand()%numCells, cellSize); 99 flags_.push_back(flag); 100 } 105 101 106 102 107 }//firsttick end … … 110 115 } 111 116 numberOfFlags_ = flags_.size(); 112 */117 113 118 } 114 119 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h
r12057 r12062 52 52 virtual void tick(float dt) override; 53 53 54 void setOrigin( HoverOrigin* origin)54 void setOrigin(OrxoKartOrigin* origin) 55 55 { this->origin_ = origin; } 56 56 -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.cc
r12057 r12062 53 53 XMLPortParam(OrxoKartOrigin, "numCells", setNumCells, getNumCells, xmlelement, mode); 54 54 XMLPortParam(OrxoKartOrigin, "cellSize", setCellSize, getCellSize, xmlelement, mode); 55 XMLPortParam(OrxoKartOrigin, " cellHeight", setCellHeight, getCellHeight, xmlelement, mode);55 XMLPortParam(OrxoKartOrigin, "mapMatrix", setMapMatrix, getMapMatrix, xmlelement, mode); 56 56 } 57 57 58 void HoverOrigin::checkGametype()58 void OrxoKartOrigin::checkGametype() 59 59 { 60 60 if (getGametype() != nullptr && this->getGametype()->isA(Class(OrxoKart))) -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartOrigin.h
r12057 r12062 61 61 { return this->cellSize_; } 62 62 63 inline void set CellHeight(int cellHeight)64 { this-> cellHeight_ = cellHeight; }65 inline int get CellHeight() const66 { return this-> cellHeight_; }63 inline void setMapMatrix(int mapMatrix) 64 { this->mapMatrix_ = mapMatrix; } 65 inline int getMapMatrix() const 66 { return this->mapMatrix_; } 67 67 68 68 private: … … 71 71 int numCells_; 72 72 int cellSize_; 73 int cellHeight_;73 int mapMatrix_; 74 74 }; 75 75 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc
r12057 r12062 28 28 29 29 /** 30 @file HoverWall.cc31 @brief Represents one Wall piece in the HoverGame30 @file OrxoKartTile.cc 31 @brief Represents one Wall piece in the OrxoKart Game 32 32 */ 33 33 34 #include " HoverWall.h"34 #include "OrxoKartTile.h" 35 35 36 36 #include "core/CoreIncludes.h" … … 40 40 namespace orxonox 41 41 { 42 RegisterClass( HoverWall);42 RegisterClass(OrxoKartTile); 43 43 44 HoverWall::HoverWall(Context* context) : StaticEntity(context)44 OrxoKartTile::OrxoKartTile(Context* context) : StaticEntity(context) 45 45 { 46 RegisterObject( HoverWall);46 RegisterObject(OrxoKartTile); 47 47 48 48 this->model_ = nullptr; … … 58 58 Destructor. 59 59 */ 60 HoverWall::~HoverWall()60 OrxoKartTile::~OrxoKartTile() 61 61 { 62 62 if (this->isInitialized()) … … 71 71 /** 72 72 @brief 73 Initializes a HoverWall73 Initializes a OrxoKartTile 74 74 @param x 75 75 x-Coordinate of the Square that the Wall is attached to, 0-9, Origin is Bottom left … … 83 83 Wall on the right side (1) or on top (2) of this square, 0-1 84 84 */ 85 void HoverWall::init(int x, int y, int cellSize, int cellHeight, int orientation)85 void OrxoKartTile::init(int x, int y, int cellSize, int cellHeight, int orientation) 86 86 { 87 87 int xSize_, zSize_, xPos_, zPos_; -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.h
r12057 r12062 28 28 29 29 /** 30 @file HoverWall.h30 @file OrxoKartTile.h 31 31 @brief See .cc-file for further information 32 @ingroup Hover32 @ingroup OrxoKart 33 33 */ 34 34 35 #ifndef _ HoverWall_H__36 #define _ HoverWall_H__35 #ifndef _OrxoKartTile_H__ 36 #define _OrxoKartTile_H__ 37 37 38 #include " HoverPrereqs.h"38 #include "OrxoKartPrereqs.h" 39 39 #include "objects/ObjectsPrereqs.h" 40 40 … … 43 43 namespace orxonox 44 44 { 45 class _ HoverExport HoverWall: public StaticEntity45 class _OrxoKartExport OrxoKartTile : public StaticEntity 46 46 { 47 47 public: 48 HoverWall(Context* context);49 virtual ~ HoverWall();48 OrxoKartTile(Context* context); 49 virtual ~OrxoKartTile(); 50 50 51 51 void init(int x, int y, int cellSize, int cellHeight, int orientation); … … 57 57 } 58 58 59 #endif /* _ HoverWall_H__ */59 #endif /* _OrxoKartTile_H__ */
Note: See TracChangeset
for help on using the changeset viewer.