Changeset 9245 for code/branches/presentation2012
- Timestamp:
- May 24, 2012, 10:07:43 PM (13 years ago)
- Location:
- code/branches/presentation2012
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012
- Property svn:mergeinfo changed
/code/branches/newlevel2012 merged: 9236
- Property svn:mergeinfo changed
-
code/branches/presentation2012/data/levels/includes/towerWeaponSettings.oxi
r9229 r9245 20 20 <Weapon> 21 21 <attached> 22 <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3, 0" scale=20/>23 <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3, 0" scale=20/>24 <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale= 20 />22 <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,200" scale=1/> 23 <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,200" scale=1 /> 24 <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,200" scale=10 /> 25 25 </attached> 26 26 <HsW01 mode=0 munitionpershot=0 delay=0.005 damage=31.4159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" /> -
code/branches/presentation2012/data/levels/templates/tower.oxt
r9229 r9245 5 5 explosionchunks = 6 6 6 7 reloadrate = 17 reloadrate = 3 8 8 reloadwaittime = 1 9 9 … … 13 13 14 14 > 15 16 17 18 <controller> 19 <WaypointPatrolController alertnessradius=10000 team=5> 20 <waypoints> 21 <Model mesh="cube.mesh" scale=20 position=" 700, 200, 100" /> 22 </waypoints> 23 </WaypointPatrolController> 24 </controller> 15 <controller> 16 <WaypointPatrolController alertnessradius=1000 team=5> 17 <waypoints> 18 <Model mesh="cube.mesh" scale=0 position=" 700, 200, 100" /> 19 </waypoints> 20 </WaypointPatrolController> 21 </controller> 25 22 26 23 27 24 <attached> 28 25 <Model position="0,0,0" scale=45 mesh="Tower.mesh" /> 29 26 </attached> 30 27 -
code/branches/presentation2012/data/levels/towerDefense.oxw
r9229 r9245 27 27 <Pawn> 28 28 <camerapositions> 29 <CameraPosition position="0,0, 2000"/>29 <CameraPosition position="0,0,1500"/> 30 30 </camerapositions> 31 31 </Pawn> … … 76 76 <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /--> 77 77 78 <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale= 2team=1 >78 <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=3 team=1 > 79 79 <templates> 80 80 <Template link=spaceshipassff /> … … 84 84 <waypoints> 85 85 <!-- 1,3 10,3 10,11, 13,11 --> 86 <Model mesh="cube.mesh" scale=20 position="-700,-500, 100" /> 87 <Model mesh="cube.mesh" scale=20 position=" 200,-500, 100" /> 88 <Model mesh="cube.mesh" scale=20 position=" 200, 300, 100" /> 89 <Model mesh="cube.mesh" scale=20 position=" 500, 300, 100" /> 86 <Model mesh="cube.mesh" scale=0 position="-700,-500, 150" /> 87 <Model mesh="cube.mesh" scale=0 position=" 200,-500, 150" /> 88 <Model mesh="cube.mesh" scale=0 position=" 200, 300, 150" /> 89 <Model mesh="cube.mesh" scale=0 position=" 500, 300, 150" /> 90 <Model mesh="cube.mesh" scale=0 position=" 500, 700, 150" /> 90 91 </waypoints> 91 92 </WaypointController> … … 99 100 <attached> 100 101 <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 /> 102 <!-- Base --> 103 <Model position="500,700,100" mesh="sphere.mesh" scale=80 /> 101 104 <!--Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /--> <!-- Only temporary needed to help align the collisionshape --> 102 105 <!-- This was used to mark the playfield, let's let it be here for now --> -
code/branches/presentation2012/src/modules/towerdefense/Tower.cc
r9229 r9245 22 22 Constructor. Registers and initializes the object. 23 23 */ 24 Tower::Tower(BaseObject* creator) : SpaceShip(creator)24 Tower::Tower(BaseObject* creator) : Pawn(creator) 25 25 { 26 26 RegisterObject(Tower); … … 36 36 */ 37 37 } 38 39 void Tower::setOrientation(const Quaternion& orientation) 40 { 41 static int ori; 42 orxout() << "orientation " << ++ori << endl; 43 } 44 45 void Tower::rotateYaw(const Vector2& value) 46 { 47 static int yaw; 48 orxout() << "rotateYaw " << ++yaw << endl; 49 } 50 51 void Tower::rotatePitch(const Vector2& value) 52 { 53 static int pitch; 54 orxout() << "rotatePitch " << ++pitch << endl; 55 } 56 57 void Tower::rotateRoll(const Vector2& value) 58 { 59 static int roll; 60 orxout() << "rotateRoll" << ++roll << endl; 61 } 62 38 63 // This function is called whenever a player presses the up or the down key. 39 64 // You have to implement what happens when the up or the down key is pressed. … … 55 80 A vector whose first component is the angle by which to rotate. 56 81 */ 82 /* 57 83 void Tower::moveFrontBack(const Vector2& value) 58 84 { 59 85 //orxout() << "frontBack.x: " << value.x << endl; 60 86 } 87 */ 61 88 62 89 /** … … 66 93 A vector whose first component is the direction in which we want to steer the stone. 67 94 */ 95 /* 68 96 void Tower::moveRightLeft(const Vector2& value) 69 97 { 70 98 //orxout() << "rightLeft.x: " << value.x << endl; 71 /*99 72 100 if(!this->delay_) 73 101 { … … 80 108 this->delay_ = true; 81 109 this->delayTimer_.startTimer(); 82 } 83 */ 110 } 84 111 } 112 */ 85 113 } -
code/branches/presentation2012/src/modules/towerdefense/Tower.h
r9229 r9245 20 20 #include "towerdefense/TowerDefensePrereqs.h" 21 21 #include "worldentities/pawns/SpaceShip.h" 22 22 23 23 24 namespace orxonox 24 25 { 25 class _OrxonoxExport Tower : public SpaceShip26 class _OrxonoxExport Tower : public Pawn 26 27 { 27 28 public: … … 29 30 virtual ~Tower() {}; 30 31 32 // Maybe later override these to move towers with cursor keys 33 /* 31 34 virtual void moveFrontBack(const Vector2& value); 32 35 virtual void moveRightLeft(const Vector2& value); 36 */ 37 38 // Overriding these to stop towers from spasing out 39 void setOrientation(const Quaternion& orientation); 40 virtual void rotateYaw(const Vector2& value); 41 virtual void rotatePitch(const Vector2& value); 42 virtual void rotateRoll(const Vector2& value); 33 43 34 44 void setGame(TowerDefense* towerdefense) -
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.cc
r9229 r9245 105 105 /* Temporary hack to allow the player to add towers */ 106 106 this->dedicatedAddTower_ = createConsoleCommand( "addTower", createExecutor( createFunctor(&TowerDefense::addTower, this) ) ); 107 108 // Quick hack to test waypoints109 createConsoleCommand( "aw", createExecutor( createFunctor(&TowerDefense::addWaypointsAndFirstEnemy, this) ) );110 107 } 111 108 … … 131 128 Deathmatch::start(); 132 129 133 orxout() << "Adding towers for debug..." << endl; 134 135 // Mark corners 136 addTower(0,15); addTower(15,0); 137 138 // Mark diagonal line 139 for (int i = 0 ; i <= 15; i++) 140 addTower(i,i); 141 142 orxout() << "Done" << endl; 130 const int kInitialTowerCount = 3; 131 Coordinate initialTowerCoordinates[kInitialTowerCount] = {{3,2}, {8,5}, {12,10}}; 132 133 for (int i = 0; i < kInitialTowerCount; i++) 134 { 135 Coordinate coordinate = initialTowerCoordinates[i]; 136 addTower(coordinate.x, coordinate.y); 137 } 143 138 144 139 ChatManager::message("Use the console command addTower x y to add towers"); 145 140 146 141 //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player 147 148 142 } 149 143 … … 198 192 newTower->addTemplate(this->center_->getTowerTemplate()); 199 193 200 //this->center_->attach(newTower); 201 202 newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100); 194 newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 75); 203 195 newTower->setGame(this); 204 //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;205 206 // TODO: create Tower mesh207 // TODO: load Tower mesh208 196 } 209 197 … … 229 217 { 230 218 SUPER(TowerDefense, tick, dt); 231 232 static int test = 0;233 if (++test == 10)234 {235 orxout()<< "10th tick." <<endl;236 /*237 for (std::set<SpawnPoint*>::iterator it = this->spawnpoints_.begin(); it != this->spawnpoints_.end(); it++)238 {239 orxout() << "checking spawnpoint with name " << (*it)->getSpawnClass()->getName() << endl;240 }241 */242 243 //addWaypointsAndFirstEnemy();244 245 }246 219 } 247 220 … … 249 222 250 223 // THE PROBLEM: WaypointController's getControllableEntity() returns null, so it won't track. How do we get the controlableEntity to NOT BE NULL??? 251 224 /* 252 225 void TowerDefense::addWaypointsAndFirstEnemy() 253 226 { … … 283 256 // this->center_->attach(newShip); 284 257 } 285 258 */ 286 259 /* 287 260 void TowerDefense::playerEntered(PlayerInfo* player) -
code/branches/presentation2012/src/modules/towerdefense/TowerDefense.h
r9229 r9245 78 78 79 79 private: 80 // WeakPtr<TowerDefenseCenterpoint> center_;81 80 TowerDefenseCenterpoint *center_; 82 81 … … 92 91 } Coordinate; 93 92 94 95 96 93 std::vector<Coordinate> addedTowersCoordinates_; 97 94 std::vector<Tower*> towers_; 98 99 void addWaypointsAndFirstEnemy();100 95 }; 101 96 } -
code/branches/presentation2012/src/modules/towerdefense/TowerDefensePlayerStats.h
r9229 r9245 43 43 { 44 44 typedef enum _TowerCosts { 45 TDDefaultTowerCost = 200 45 // Set to 0 for debug... 46 TDDefaultTowerCost = 0 46 47 } TowerCost; 47 48
Note: See TracChangeset
for help on using the changeset viewer.