Changeset 12108 for code/branches/OrxoKart_HS18/src/modules
- Timestamp:
- Nov 21, 2018, 9:32:15 AM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18/src/modules/orxokart
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/src/modules/orxokart/CMakeLists.txt
r12074 r12108 4 4 OrxoKartTile.cc 5 5 OrxoKartOrigin.cc 6 OrxoKartFlag.cc 6 7 TimeHUD.cc 7 8 ) -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.cc
r12090 r12108 33 33 34 34 #include "OrxoKart.h" 35 35 #include "OrxoKartFlag.h" 36 #include "OrxoKartKart.h" 36 37 #include "OrxoKartOrigin.h" 37 38 #include "OrxoKartTile.h" … … 47 48 48 49 this->origin_ = nullptr; 49 //this->numberOfFlags_ = 1;50 this->numberOfFlags_ = 1; 50 51 this->firstTick_ = true; 51 52 … … 57 58 SUPER(OrxoKart, tick, dt); 58 59 60 59 61 if(this->firstTick_ && this->origin_) 60 62 { … … 64 66 int s = this->origin_->getCellSize(); 65 67 66 int levelcodeArray[] = {1,1,1,1,1,1,1,1,0,0,0 67 ,1,0,0,0,0,0,0,1,1,1,0 68 ,1,0,1,1,1,1,0,0,0,1,1 69 ,1,1,1,0,0,1,1,0,0,0,1 70 ,0,0,0,0,0,0,1,0,1,1,1 71 ,1,1,1,1,1,1,1,0,1,0,0 72 ,1,0,0,0,0,0,0,0,1,0,0 73 ,1,0,0,0,0,0,0,0,1,0,0 74 ,1,1,1,1,1,0,0,0,1,1,1 75 ,0,0,0,0,1,0,0,0,0,0,1 76 ,0,0,0,0,1,1,1,2,1,1,1}; 68 int map_1[] = {1,1,1,1,1,1,1,1,0,0,0 69 ,1,0,0,0,0,0,0,1,1,1,0 70 ,1,0,1,1,1,1,0,0,0,1,1 71 ,1,1,1,0,0,1,1,0,0,0,1 72 ,0,0,0,0,0,0,1,0,1,1,1 73 ,1,1,1,1,1,1,1,0,1,0,0 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0,1,0,0,1,0,0,0,0, 97 0,1,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0, 98 0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0, 99 0,1,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1, 100 0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1, 101 0,1,0,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1, 102 0,1,1,1,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1, 103 0,0,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,1, 104 0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,1,1,1,0,1,1,1}; 105 106 107 108 int *levelcodeArray = map_2; 77 109 78 110 … … 85 117 } 86 118 119 //bottom flag 120 121 OrxoKartFlag* flag = new OrxoKartFlag(origin_->getContext()); 122 flag->init(n, s); 123 flag_ = flag; 124 125 126 87 127 88 128 89 129 }//firsttick end 90 /* 91 // Check if ship collided with one of the flags 92 for ( unsigned int i = 0; i < flags_.size(); i++ ){ 93 if(flags_[i]->getCollided()){ 94 flags_[i]->destroyLater(); 95 flags_.erase (flags_.begin()+i); 96 } 130 131 132 133 // Check if ship collided with the flag 134 if(flag_->getCollided()){ 135 OrxoKartKart* player = flag_->getObjectofCollision(); 136 orxout() << "Orientation= " << player->getOrientation() << endl; 137 player->setPosition(Vector3(80*0, 40, 80*18)); 138 player->setOrientation(Quaternion(1, 0, 0, 0)); // 0, 0, 0 139 player->setVelocity(Vector3(0,0,0)); 140 player->setAcceleration(Vector3(0,0,0)); 141 flag_->setCollided(false); 142 143 144 // flag_->destroyLater(); 145 // flags_.erase (flags_.begin()+i); 146 numberOfFlags_ = 0; 97 147 } 98 numberOfFlags_ = flags_.size(); */99 148 100 149 } -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKart.h
r12074 r12108 55 55 { this->origin_ = origin; } 56 56 57 /*inline int getNumberOfFlags() const58 { return this->numberOfFlags_; } */57 inline int getNumberOfFlags() const 58 { return this->numberOfFlags_; } 59 59 60 60 private: 61 61 WeakPtr<OrxoKartOrigin> origin_; 62 OrxoKartFlag* flag_; 62 63 //std::vector<OrxoKartFlag*> flags_; 63 //int numberOfFlags_;64 int numberOfFlags_; 64 65 bool firstTick_; 65 66 }; -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartPrereqs.h
r12057 r12108 69 69 { 70 70 class OrxoKart; 71 class OrxoKartFlag; 71 72 class OrxoKartOrigin; 72 73 class OrxoKartKart; -
code/branches/OrxoKart_HS18/src/modules/orxokart/TimeHUD.cc
r12074 r12108 82 82 { 83 83 this->setCaption(getTimeString(this->time_)); 84 //if (this->orxokartGame_->getNumberOfFlags() == 0)85 //setRunning(false);84 if (this->orxokartGame_->getNumberOfFlags() == 0) 85 setRunning(false); 86 86 } 87 87
Note: See TracChangeset
for help on using the changeset viewer.