Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 29, 2012, 12:40:11 PM (13 years ago)
Author:
mentzerf
Message:

Fixed the oxw file (some more):

  • the playfield now lies in the x,y layer, the camera is at z = 20, as it should be
  • the towers are now longer to be able to see if they fit the playfield marks (they do!)
  • moved the playfield, so that towers x,y can easily be mapped to the playfield coordinates. e.g. adding a tower at 0,4 results in -8,-4, the corners of the playfield are at 8,8 / -8,-8 / -8,8 / 8,-8
  • the centerpoint is marked with a cylinder
File:
1 edited

Legend:

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

    r9137 r9138  
    6363#include "worldentities/pawns/SpaceShip.h"
    6464
     65#include "chat/ChatManager.h"
     66
    6567/* Part of a temporary hack to allow the player to add towers */
    6668#include "core/command/ConsoleCommand.h"
     
    98100    {
    99101        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");
    101116    }
    102117       
     
    113128        void TowerDefense::addTower(int x, int y)
    114129        {
    115                 if (x > 16 || y > 16)
     130                if (x > 15 || y > 15 || x < 0 || y < 0)
    116131                {
    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;
    118133                        return;
    119134                }
    120135               
    121                 orxout()<< "Should add tower at (" << x << "," << y << ")" << endl;
     136                orxout()<< "Will add tower at (" << x << "," << y << ")" << endl;
    122137               
    123138                Tower* newTower = new Tower(this->center_);
     
    126141                this->center_->attach(newTower);
    127142               
    128                 newTower->setPosition(0,0,0);
     143                newTower->setPosition(x-8,y-8,0);
    129144                newTower->setGame(this);
    130                
    131145               
    132146                // TODO: create Tower mesh
Note: See TracChangeset for help on using the changeset viewer.