Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9837 for code


Ignore:
Timestamp:
Dec 2, 2013, 2:08:46 PM (11 years ago)
Author:
zifloria
Message:

new Explosions!!!

Location:
code/branches/invaders/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/invaders/src/modules/invader/Invader.cc

    r9829 r9837  
    8787            return;
    8888
    89         InvaderEnemy* newPawn = new InvaderEnemy(this->center_->getContext());
    90         newPawn->addTemplate("enemyinvader");
    91 
    92         newPawn->setPosition(player->getPosition() + Vector3(1000, 0, 0)); // BUG:
     89        for (int i = 0; i < level; i++)
     90        {
     91            SmartPtr<InvaderEnemy> newPawn = new InvaderEnemy(this->center_->getContext());
     92            newPawn->addTemplate("enemyinvader");
     93            newPawn->setPosition(player->getPosition() + Vector3(500 + 100 * i, 0, 0));
     94        }
    9395    }
    9496
  • code/branches/invaders/src/modules/invader/Invader.h

    r9829 r9837  
    6767            int getPoints(){return this->point;}
    6868
    69             void costLife(){lives--; if (lives == 0) orxout() << "end<<<<<<<<<<<<<<<<<" << endl;};
     69            void costLife(){lives--; if (lives <= 0) end();};
    7070            void levelUp(){level++;}
    7171            void addPoints(int numPoints){point += numPoints * multiplier; b_combo = true;}
  • code/branches/invaders/src/modules/invader/InvaderEnemy.cc

    r9829 r9837  
    4848    void InvaderEnemy::tick(float dt)
    4949    {
     50        setVelocity(Vector3(500 ,0, 0));
    5051        SUPER(InvaderEnemy, tick, dt);
    5152    }
     
    5354    inline bool InvaderEnemy::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    5455    {
    55         orxout() << "sadsadasfasf" << endl;
     56        setVelocity(Vector3(900,0,0));
    5657        removeHealth(2000);
    57         setVelocity(Vector3(0,0,1000));
    5858        return false;
    5959    }
  • code/branches/invaders/src/orxonox/worldentities/BigExplosion.cc

    r9667 r9837  
    4343    RegisterClass(BigExplosion);
    4444
    45     BigExplosion::BigExplosion(Context* context) : StaticEntity(context)
     45    BigExplosion::BigExplosion(Context* context) : MobileEntity(context)
    4646    {
    4747        RegisterObject(BigExplosion);
     
    100100        this->debris4_->setSyncMode(0);
    101101
    102         this->explosion_ = new StaticEntity(this->getContext());
     102        this->explosion_ = new MobileEntity(this->getContext());
    103103        this->explosion_->setSyncMode(0);
    104104
  • code/branches/invaders/src/orxonox/worldentities/BigExplosion.h

    r9667 r9837  
    2222 *   Author:
    2323 *      Benjamin de Capitani
    24  *   Co-authors:
     24 *   Co-authors:§
    2525 *      ...
    2626 *
     
    3333
    3434#include "tools/Timer.h"
    35 #include "StaticEntity.h"
     35#include "MobileEntity.h"
    3636
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport BigExplosion : public StaticEntity
     39    class _OrxonoxExport BigExplosion : public MobileEntity
    4040    {
    4141        public:
     
    6060            bool                  bStop_;
    6161
    62             StaticEntity*         explosion_;
     62            MobileEntity*         explosion_;
    6363
    6464            MovableEntity*        debrisEntity1_;
  • code/branches/invaders/src/orxonox/worldentities/pawns/Pawn.cc

    r9667 r9837  
    367367        BigExplosion* chunk = new BigExplosion(this->getContext());
    368368        chunk->setPosition(this->getPosition());
     369        chunk->setVelocity(this->getVelocity());
    369370
    370371    }
Note: See TracChangeset for help on using the changeset viewer.