Changeset 9143 for code/branches
- Timestamp:
- May 2, 2012, 1:22:20 PM (13 years ago)
- Location:
- code/branches/newlevel2012
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/newlevel2012/.project
r9096 r9143 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name>Orxonox-Source@ newlevel2012</name>3 <name>Orxonox-Source@towerDefense</name> 4 4 <comment></comment> 5 5 <projects> -
code/branches/newlevel2012/data/levels/towerDefense.oxw
r9142 r9143 99 99 100 100 <attached> 101 102 101 <Model position="-0.5,-0.5,0" mesh="Playfield_ME.mesh" scale=0.8 /> 103 102 <!--Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /--> <!-- Only temporary needed to help align the collisionshape --> 104 103 <!-- This was used to mark the playfield, let's let it be here for now --> 105 104 <!--Model position="-8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> … … 107 106 <!--Model position="8,-8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 108 107 <!--Model position="8,8,0" mesh="crate.mesh" scale3D="0.3,0.3,0.3" /--> 109 110 108 </attached> 109 <collisionShapes> <!-- The collisionshape forbids other worldentities that have a collisionShape to fly through it. 110 111 TODO: Find correct size for the collisionshape; since a collisionShape is invisible 112 I added the crate wich currently has the same dimensions as the collisionshape. 113 You have to adjust the crate's scale3D as well as the collisionshape's halfExtens to 114 find the proper shape. --> 115 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 116 </collisionShapes> 111 117 </TowerDefenseCenterpoint> 112 118 -
code/branches/newlevel2012/src/modules/towerdefense/Tower.cc
r9141 r9143 31 31 */ 32 32 } 33 33 // This function is called whenever a player presses the up or the down key. 34 // You have to implement what happens when the up or the down key is pressed. 35 // value.x < 0 means: down key is pressed. 36 // I suggest to create a new class which is a controllable entity I will refer to as "TowerMover". This is the controllable entity that the 37 // player controls in order to move the tower along the centerpoint and in order to place the tower at the appropriate position. 38 // 39 40 // The tower itsself is controlled by a WayPointPatroController at the instance you place it on the centerpoint. 41 //(don't forget to set the team_ parameter such that all tower are in the same team) 42 43 //How to move a tower: simply attach the tower to the TowerMover 44 //How to place a tower: detach the tower from the TowerMover 45 34 46 /** 35 47 @brief -
code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc
r9142 r9143 26 26 * 27 27 *NACHRICHT: 28 * Ich habe die Klasse Deathmatch einfach per Copy&Paste&Rename als Vorlage für euren Deathmatch genommen.29 * Ein Deathmatch erbt vom Gametype. Der einzige Unterschied zum Gametype ist, dass hier ein bisschen30 * Textausgabe stattfindet. Sollte das Später nicht erwünscht sein, könnt ihr einfach die Gametype-Klasse31 * an die Stelle von Deathmatch setzten.32 28 * 33 29 * Hier empfehle ich euch die gesamte Spielogik unter zu bringen. Viele Funktionen werden automatisch … … 52 48 * z.B: WaypointPatrolController. Wenn kein Team zugewiesen wurde bekämpft ein WaypointPatrolController alles, 53 49 * was in seiner Reichweite liegt. 50 * 51 * 52 *HUD: 53 * Ein Gametype kann ein HUD (Head up Display haben.) Z.B: hat Pong eine Anzeige welcher Spieler wieviele Punkte hat. 54 * Generell kann man a) Grafiken oder b) Zeichen in einer HUD anzeigen. 55 * Fuer den ersten Schritt reicht reiner Text. 56 * 57 * a) 58 * PongScore.cc uebernehmen und eigene Klasse draus machen. 59 * Wenn ihr bloss anzeigen wollt wieviele Punkte der Spieler bereits erspielt hat (Punkte = Kapital fuer neue Tuerme) dann orientiert ihr euch an 60 * TetrisScore.cc (im pCuts branch): http://www.orxonox.net/browser/code/branches/pCuts/src/modules/tetris/TetrisScore.cc 61 * Ich habe TetrisScore lediglich dazu gebraucht, um eine Variable auf dem HUD auszugeben. Ein Objekt fuer statischen Text gibt es bereits. 62 * 63 * b) 64 * Im naesten Schritt erstellt man die Vorlage fuer das HUD-Objekt: siehe /data/overlays/pongHUD 65 * OverlayText ist eine Vorlage fuer statischen text zb: "Points Scored:". Aus mir nicht erklaerlichen Gruenden sollte man die OverlayText 66 * Objekte immer erst nach dem PongScore anlegen. 67 * 68 * c) Im TowerDefense gamtype muss im Constructor noch das HUD-Template gesetzt werden. 69 * 70 * d) in CMakeLists.txt noch das Module includen das fuer die Overlays zustaendig ist. Siehe das gleiche File im Pong module. 71 * 72 * 54 73 * 55 74 */ … … 119 138 120 139 ChatManager::message("Use the console command addTower x y to add towers"); 140 141 //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player 142 121 143 } 122 144 … … 131 153 void TowerDefense::addTower(int x, int y) 132 154 { 133 if (x > 15 || y > 15 || x < 0 || y < 0) 155 if (x > 15 || y > 15 || x < 0 || y < 0)//Hard coded: TODO: let this depend on the centerpoint's height, width and fieldsize (fieldsize doesn't exist yet) 134 156 { 135 157 orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl; … … 146 168 newTower->setPosition(x-8,y-8,0); 147 169 newTower->setGame(this); 170 //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable; 148 171 149 172 // TODO: create Tower mesh -
code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h
r9142 r9143 70 70 ConsoleCommand* dedicatedAddTower_; 71 71 72 //TODO: void spawnNewWave() 73 //TODO: create a timer which regularly calls the spawnNewWave function (time driven) 74 // or spawn a new wave when the old wave has been killed (event driven) 75 76 72 77 private: 73 78 // WeakPtr<TowerDefenseCenterpoint> center_; -
code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc
r9141 r9143 69 69 XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, setWidth, xmlelement, mode); 70 70 XMLPortParam(TowerDefenseCenterpoint, "towerTemplate", setTowerTemplate, getTowerTemplate, xmlelement, mode); 71 //TODO: add XMLPortObject(TowerDefenseCenterpoint, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode); 72 // This was copied and shightly modified from WaypointController.cc ; there are no getters and setters and no membervariable yet 73 // The centerpoint should have all waypoints for "attached" to it. By using this function you can seperately add waypoints 74 // When you spawn a new enemy you should let it be controlled by a WaypointController. And that controller should get the waypoints. 75 76 // Alternatively you can manage the waypoints directly in TowerDefense.cc 71 77 } 72 78 -
code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt
r9141 r9143 11 11 Tower 12 12 Represents a Tower 13 I'm not actually sure if you have to code C++ in order to have your result. I would suggest to simply create a new spaceship template or maybe better a 14 new template for a pawn. (The tower don't need to be spaceships; pawn is just fine.) 15 Example for a template: /data/levels/templates/assff.oxt && /data/levels/include/weaponSettingsAssff.oxi 16 @ assff.oxt: you don't need an engine (or your towers could fly away :-) and probably no Cameras. (just try what happens if you leave them out.) 17 @ weaponSettingsAssff.oxi: 18 <weaponslots>: location where you want to have your tower to be equiped with weapons 19 <weaponsets> : if you press fire, you actually always fire a whole set of weapons. The amount of weaponsets is defined here. (I'm not 100% sure whether this explanation is right.) 20 21 There are three <Weapon> tags - one for each weaponslot. Each weapon can contain several objects which you would probably 22 refer to as "weapons": 23 24 LightningGun: Shoots a slow, rotation, yellow "ball". 25 HsW01: the default laser weapon 26 SimpleRocketFire: a weak (self steering) rocket 27 RocketFire: a strong rocket 28 29 About your Tower's Template location - either keep it in the level or do it similarly to the Assff templates. 30 (If your towers behave & look nicely, I'm quite sure others want to include them in other levels, too.) 13 31 14 32
Note: See TracChangeset
for help on using the changeset viewer.