Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9175 for code


Ignore:
Timestamp:
May 11, 2012, 4:03:28 PM (13 years ago)
Author:
weigeltm
Message:

removed attach-command, got rid of error messages, attached weapons to towers

Location:
code/branches/newlevel2012
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/newlevel2012/data/levels/includes/towerWeaponSettings.oxi

    r9161 r9175  
    2020        <Weapon>
    2121          <attached>
    22             <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" />
    23             <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
    24             <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
     22            <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" scale=1/>
     23            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" scale=1 />
     24            <Model mesh="hs-w01_reduced.mesh" roll="45" pitch="-76" yaw="-45" position="-1.5,1,0.3" scale=100 />
    2525          </attached>
    2626          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
  • code/branches/newlevel2012/data/levels/templates/tower.oxt

    r9161 r9175  
    11<Template name=tower>
    2   <SpaceShip
     2  <Tower
    33
    4    spawnparticlesource    = "Orxonox/fairytwirl"
    5    spawnparticleduration  = 3
     4 
    65   explosionchunks        = 6
    76
    8    health            = 100
    9    maxhealth         = 200
    10    initialhealth     = 100
    11 
    12    shieldhealth        = 30
    13    initialshieldhealth = 30
    14    maxshieldhealth     = 50
    15    shieldabsorption    = 0.8
    167   reloadrate          = 1
    178   reloadwaittime      = 1
    189
    19    lift = 1;
    20    stallSpeed = 220;
     10   collisionType     = "dynamic"
     11   team = 13
    2112
    22    collisionType     = "dynamic"
    23    mass              = 100
    24    linearDamping     = 0.7
    25    angularDamping    = 0.9999999
    2613  >
    2714
     
    3320
    3421
    35     <!--attached>
    36       <Model position="0,0,0" scale=25 mesh="Tower_ME.mesh" />
    37     </attached-->
     22    <attached>
     23      <Model position="0,0,0" scale=50 mesh="Tower_ME.mesh" />
     24    </attached>
    3825
    3926    <!--collisionShapes>
     
    4431  include("../includes/towerWeaponSettings.oxi")
    4532?>
    46   </SpaceShip>
     33  </Tower>
    4734</Template>
    4835
  • code/branches/newlevel2012/data/levels/towerDefense.oxw

    r9173 r9175  
    5151</Template-->
    5252
     53
     54
     55
     56
    5357<Level gametype = "TowerDefense">
    5458  <templates>
     
    8084          <waypoints>
    8185                          <!-- 1,3 10,3 10,11, 13,11 -->
    82             <Model mesh="cube.mesh" scale=1 position="-700,-500, 100" />
    83             <Model mesh="cube.mesh" scale=1 position=" 200,-500, 100" />
    84             <Model mesh="cube.mesh" scale=1 position=" 200, 300, 100" />
    85             <Model mesh="cube.mesh" scale=1 position=" 500, 300, 100" />
     86            <Model mesh="cube.mesh" scale=20 position="-700,-500, 100" />
     87            <Model mesh="cube.mesh" scale=20 position=" 200,-500, 100" />
     88            <Model mesh="cube.mesh" scale=20 position=" 200, 300, 100" />
     89            <Model mesh="cube.mesh" scale=20 position=" 500, 300, 100" />
    8690          </waypoints>
    8791        </WaypointController>
     
    8993    </SpaceShip>
    9094   
    91         <!-- PlayField -->
    92         <TowerDefenseCenterpoint
    93         name=towerdefensecenter
    94         width=16
    95         height=16
    96         tileScale=100
    97         towerTemplate=tower
    98         position="0,0,0"
    99         direction="0,0,0"
    100         collistionType=static
    101         mass=100000>
    102                  
     95   
     96    <!--invisible entity to attach towers to, since playfield is static and towers are dynamic-->
     97    <StaticEntity position=0,0,0>
     98 
    10399                 <attached>
    104100                        <Model position="-50,-50,0" mesh="Playfield_ME.mesh" scale=80 />
     
    118114           <BoxCollisionShape position="0,0,0" halfExtents="400,400,100" />
    119115        </collisionShapes>
     116        </StaticEntity>
     117   
     118   
     119   
     120   
     121        <!-- PlayField -->
     122        <TowerDefenseCenterpoint
     123        name=towerdefensecenter
     124        width=16
     125        height=16
     126        tileScale=100
     127        towerTemplate=tower
     128        position="0,0,0"
     129        direction="0,0,0"
     130        collisionType=dynamic
     131        mass=100000>
     132               
    120133    </TowerDefenseCenterpoint>
    121134
  • code/branches/newlevel2012/src/modules/towerdefense/Tower.cc

    r9161 r9175  
    2222         Constructor. Registers and initializes the object.
    2323         */
    24     Tower::Tower(BaseObject* creator) : ControllableEntity(creator)
     24    Tower::Tower(BaseObject* creator) : SpaceShip(creator)
    2525    {
    2626        RegisterObject(Tower);
     27
     28        this->setCollisionType(WorldEntity::Dynamic);
     29
     30
     31
    2732        /*
    2833        this->size_ = 10.0f;
  • code/branches/newlevel2012/src/modules/towerdefense/Tower.h

    r9141 r9175  
    1919
    2020#include "towerdefense/TowerDefensePrereqs.h"
    21 #include "worldentities/ControllableEntity.h"
     21#include "worldentities/pawns/SpaceShip.h"
    2222
    2323namespace orxonox
    2424{
    25     class _OrxonoxExport Tower : public ControllableEntity
     25    class _OrxonoxExport Tower : public SpaceShip
    2626    {
    2727        public:
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefense.cc

    r9172 r9175  
    118118        void TowerDefense::setCenterpoint(TowerDefenseCenterpoint *centerpoint)
    119119        {
     120                orxout() << "Centerpoint now setting..." << endl;
     121                this->center_ = centerpoint;
    120122                orxout() << "Centerpoint now set..." << endl;
    121                 this->center_ = centerpoint;
    122123        }
    123124       
     
    191192                Tower* newTower = new Tower(this->center_);
    192193                newTower->addTemplate(this->center_->getTowerTemplate());
    193                
    194                 this->center_->attach(newTower);
    195                
     194
     195                //this->center_->attach(newTower);
     196
    196197                newTower->setPosition((x-8) * tileScale, (y-8) * tileScale, 100);
    197198                newTower->setGame(this);
    198                
    199199                //TODO: Save the Tower in a Vector. I would suggest std::vector< std::vector<Tower*> > towers_ as a protected member variable;
    200200               
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.cc

    r9154 r9175  
    4747        Constructor. Registers and initializes the object and checks whether the gametype is actually TowerDefense.
    4848    */
    49     TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : StaticEntity(creator)
     49    TowerDefenseCenterpoint::TowerDefenseCenterpoint(BaseObject* creator) : MobileEntity(creator)
    5050    {
    5151        RegisterObject(TowerDefenseCenterpoint);
     
    5555        this->towerTemplate_ = "";
    5656       
     57        //this->setCollisionType(Static);
     58
    5759                this->checkGametype();
     60
    5861    }
    5962
  • code/branches/newlevel2012/src/modules/towerdefense/TowerDefenseCenterpoint.h

    r9154 r9175  
    4242#include <util/Math.h>
    4343
    44 #include "worldentities/StaticEntity.h"
     44#include "worldentities/MobileEntity.h"
    4545
    4646namespace orxonox
    4747{
    48     class _TowerDefenseExport TowerDefenseCenterpoint : public StaticEntity
     48    class _TowerDefenseExport TowerDefenseCenterpoint : public MobileEntity
    4949    {
    5050        public:
  • code/branches/newlevel2012/src/orxonox/worldentities/WorldEntity.cc

    r8858 r9175  
    379379        if (!object->notifyBeingAttached(this))
    380380            return;
    381 
    382381        this->attachNode(object->node_);
    383382        this->children_.insert(object);
Note: See TracChangeset for help on using the changeset viewer.