Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • 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.