Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2012, 1:22:20 PM (12 years ago)
Author:
jo
Message:

Some hints added on how to proceed.

Location:
code/branches/newlevel2012/src/modules/towerdefense
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/newlevel2012/src/modules/towerdefense/Tower.cc

    r9141 r9143  
    3131                */
    3232    }
    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
    3446    /**
    3547         @brief
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc

    r9142 r9143  
    2626 *
    2727 *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 bisschen
    30  * Textausgabe stattfindet. Sollte das Später nicht erwünscht sein, könnt ihr einfach die Gametype-Klasse
    31  * an die Stelle von Deathmatch setzten.
    3228 *
    3329 * Hier empfehle ich euch die gesamte Spielogik unter zu bringen. Viele Funktionen werden automatisch
     
    5248 * z.B: WaypointPatrolController. Wenn kein Team zugewiesen wurde bekämpft ein WaypointPatrolController alles,
    5349 * 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 *
    5473 *
    5574 */
     
    119138               
    120139                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
    121143        }
    122144       
     
    131153        void TowerDefense::addTower(int x, int y)
    132154        {
    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)
    134156                {
    135157                        orxout() << "Can not add Tower: x and y should be between 0 and 15" << endl;
     
    146168                newTower->setPosition(x-8,y-8,0);
    147169                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;
    148171               
    149172                // TODO: create Tower mesh
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.h

    r9142 r9143  
    7070                ConsoleCommand* dedicatedAddTower_;
    7171               
     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
    7277        private:
    7378//              WeakPtr<TowerDefenseCenterpoint> center_;
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc

    r9141 r9143  
    6969        XMLPortParam(TowerDefenseCenterpoint, "height", setHeight, setWidth, xmlelement, mode);
    7070        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
    7177    }
    7278
  • code/branches/newlevel2012/src/modules/towerdefense/towerdefensereadme.txt

    r9141 r9143  
    1111Tower
    1212Represents a Tower
     13I'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
     14new template for a pawn. (The tower don't need to be spaceships; pawn is just fine.)
     15Example 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
     21There are three <Weapon> tags - one for each weaponslot. Each weapon can contain several objects which you would probably
     22refer to as "weapons":
     23
     24LightningGun: Shoots a slow, rotation, yellow "ball".
     25HsW01: the default laser weapon
     26SimpleRocketFire: a weak (self steering) rocket
     27RocketFire: a strong rocket
     28                         
     29About 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.)
    1331
    1432
Note: See TracChangeset for help on using the changeset viewer.