Changeset 9138 for code/branches/newlevel2012
- Timestamp:
- Apr 29, 2012, 12:40:11 PM (13 years ago)
- Location:
- code/branches/newlevel2012
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/newlevel2012/data/levels/towerDefense.oxw
r9137 r9138 30 30 <Pawn> 31 31 <camerapositions> 32 <CameraPosition position="0,0,20" absolute=true/>32 <CameraPosition position="0,0,20"/> 33 33 </camerapositions> 34 34 </Pawn> … … 39 39 <Pawn camerapositiontemplate=playfieldcameras> 40 40 <attached> 41 <Model position="0,0,0" orientation="1,1,1,1" mesh="crate.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this -->41 <Model position="0,0,0" mesh="cylinder.mesh" scale3D="1,1,1" /> <!-- the camera is attached to this --> 42 42 </attached> 43 43 </Pawn> 44 44 </Template> 45 45 46 46 47 <!-- Template for a tower --> … … 48 49 <Tower> 49 50 <attached> 50 <Model position=" 15,0,0" mesh="cube_green.mesh" scale=1/>51 <Model position="0,0,0" scale3D="0.5,0.5,2" mesh="cube_green.mesh" /> 51 52 </attached> 52 53 </Tower> … … 66 67 67 68 <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> 68 <!--SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /-->69 69 70 70 71 <!-- Spawns the camera, attached to a crate --> 71 <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=Pawn pawndesign=playfield /> 72 72 <SpawnPoint team=0 position="0,0,0" spawnclass=Pawn pawndesign=playfield /> 73 74 73 75 <!--SpawnPoint team=1 position="0,0,10" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /--> 74 76 <!--SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /--> 75 77 76 78 … … 99 101 towerTemplate=towertemplate 100 102 position="0,0,0" 101 direction=" 1,0,0"103 direction="0,0,0" 102 104 collistionType=static 103 105 mass=100000> 104 <attached> 105 <Model position="0,0,0" orientation="1,1,1,1" mesh="Playfield_ME.mesh" scale3D="1,1,1" /> 106 107 <attached> 108 109 <Model position="-0.5,-0.5,0" mesh="Playfield_ME.mesh" scale=0.8 /> 110 111 <!--Model position="-8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 112 <!--Model position="-8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 113 <!--Model position="8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 114 <!--Model position="8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 115 116 <!--Model position="0,0,50" direction="0,0,0" mesh="rocket.mesh" scale3D="0.3,0.3,0.3" /--> 117 106 118 </attached> 107 119 </TowerDefenseCenterpoint> -
code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc
r9137 r9138 63 63 #include "worldentities/pawns/SpaceShip.h" 64 64 65 #include "chat/ChatManager.h" 66 65 67 /* Part of a temporary hack to allow the player to add towers */ 66 68 #include "core/command/ConsoleCommand.h" … … 98 100 { 99 101 Deathmatch::start(); 100 orxout()<< "This is a way to display output on the terminal." <<endl; 102 103 orxout()<< "Adding towers for debug..." <<endl; 104 105 addTower(0,15); 106 addTower(15,0); 107 108 for (int i = 0 ; i <= 15; i++) 109 { 110 addTower(i,i); 111 } 112 113 orxout()<< "Done" <<endl; 114 115 ChatManager::message("Use the console command addTower x y to add towers"); 101 116 } 102 117 … … 113 128 void TowerDefense::addTower(int x, int y) 114 129 { 115 if (x > 1 6 || y > 16)130 if (x > 15 || y > 15 || x < 0 || y < 0) 116 131 { 117 orxout() << " x and y should be between 1 and 16" << endl;132 orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl; 118 133 return; 119 134 } 120 135 121 orxout()<< " Shouldadd tower at (" << x << "," << y << ")" << endl;136 orxout()<< "Will add tower at (" << x << "," << y << ")" << endl; 122 137 123 138 Tower* newTower = new Tower(this->center_); … … 126 141 this->center_->attach(newTower); 127 142 128 newTower->setPosition( 0,0,0);143 newTower->setPosition(x-8,y-8,0); 129 144 newTower->setGame(this); 130 131 145 132 146 // TODO: create Tower mesh
Note: See TracChangeset
for help on using the changeset viewer.