Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9138


Ignore:
Timestamp:
Apr 29, 2012, 12:40:11 PM (12 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
Location:
code/branches/newlevel2012
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/newlevel2012/data/levels/towerDefense.oxw

    r9137 r9138  
    3030  <Pawn>
    3131    <camerapositions>
    32       <CameraPosition position="0,0,20" absolute=true />
     32      <CameraPosition position="0,0,20"/>
    3333    </camerapositions>
    3434  </Pawn>
     
    3939  <Pawn camerapositiontemplate=playfieldcameras>
    4040    <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 -->
    4242    </attached>
    4343  </Pawn>
    4444</Template>
     45
    4546
    4647<!-- Template for a tower -->
     
    4849  <Tower>
    4950    <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" />
    5152    </attached>
    5253  </Tower>
     
    6667
    6768    <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   
    6970   
    7071        <!-- 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       
    7375        <!--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 /-->
    7577       
    7678       
     
    99101        towerTemplate=towertemplate
    100102        position="0,0,0"
    101         direction="1,0,0"
     103        direction="0,0,0"
    102104        collistionType=static
    103105        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                       
    106118        </attached>
    107119    </TowerDefenseCenterpoint>
  • 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.