Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

new Explosions!!!

Location:
code/branches/invaders/src/modules/invader
Files:
3 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    }
Note: See TracChangeset for help on using the changeset viewer.