Changeset 9138 for code/branches/newlevel2012/src/modules
- Timestamp:
- Apr 29, 2012, 12:40:11 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.