Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9879


Ignore:
Timestamp:
Dec 9, 2013, 2:08:26 PM (10 years ago)
Author:
zifloria
Message:

tweaking + still trying to figure out explosions

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

Legend:

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

    r9874 r9879  
    6969        bEndGame = false;
    7070        lives = 3;
    71         // TODO:
    7271        level = 1;
    7372        point = 0;
     
    114113            return;
    115114        srand(player->getPosition().x + player->getPosition().y);
    116         for (int i = 0; i < (3*log(level) + 1); i++)
     115        for (int i = 0; i < (3*log10(level) + 1); i++)
    117116        {
    118117            WeakPtr<InvaderEnemy> newPawn;
  • code/branches/invaders/src/modules/invader/InvaderWeaponEnemy.cc

    r9874 r9879  
    4848        // SUPER(InvaderWeaponEnemy, shot);
    4949        // only shoot in foreward direction
    50         projectile->setVelocity(Vector3(1, 0, 0) * -500);
     50        projectile->setVelocity(Vector3(1, 0, 0) * 300);
    5151        // projectile->setOrientation(Quaternion(sqrt(0.5),0,sqrt(0.5),0));
    5252    }
  • code/branches/invaders/src/orxonox/worldentities/BigExplosion.cc

    r9869 r9879  
    7878    }
    7979
     80    BigExplosion::BigExplosion(Context* context, Vector3 initVelocity) : MobileEntity(context)
     81    {
     82        RegisterObject(BigExplosion);
     83        this->setVelocity(initVelocity);
     84
     85        if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
     86            ThrowException(AbortLoading, "Can't create BigExplosion, no scene or no scene manager given.");
     87
     88        this->bStop_ = false;
     89        this->LOD_ = LODParticle::Normal;
     90
     91        if ( GameMode::showsGraphics() )
     92        {
     93            try
     94            {
     95                this->init();
     96            }
     97            catch (const std::exception& ex)
     98            {
     99                orxout(internal_error) << "Couldn't load particle effect in BigExplosion: " << ex.what() << endl;
     100                this->initZero();
     101            }
     102        }
     103        else
     104        {
     105            this->initZero();
     106        }
     107
     108        if (GameMode::isMaster())
     109        {
     110            this->destroyTimer_.setTimer(rnd(2, 4), false, createExecutor(createFunctor(&BigExplosion::stop, this)));
     111        }
     112
     113        this->registerVariables();
     114    }
     115
    80116    void BigExplosion::init()
    81117    {
     
    152188        //
    153189        ParticleSpawner* effect = new ParticleSpawner(this->getContext());
    154         // orxout() << "vel " << getVelocity() << endl;
    155         // effect->setVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1))*rnd(10, 200));
     190        orxout() << "vel " << this->getVelocity() << endl;
     191        // effect->setVelocity(this->getVelocity());
    156192        effect->setDestroyAfterLife(true);
    157193        effect->setSource("Orxonox/explosion2b");
  • code/branches/invaders/src/orxonox/worldentities/BigExplosion.h

    r9837 r9879  
    4141        public:
    4242            BigExplosion(Context* context);
     43            BigExplosion(Context* context, Vector3 initVelocity);
    4344            virtual ~BigExplosion();
    4445
  • code/branches/invaders/src/orxonox/worldentities/pawns/Pawn.cc

    r9837 r9879  
    365365        this->setDestroyWhenPlayerLeft(false);
    366366
    367         BigExplosion* chunk = new BigExplosion(this->getContext());
     367        orxout() << "big explosion: " << this->getVelocity() << endl;
     368        BigExplosion* chunk = new BigExplosion(this->getContext(), this->getVelocity());
    368369        chunk->setPosition(this->getPosition());
    369         chunk->setVelocity(this->getVelocity());
     370        // chunk->setVelocity(this->getVelocity());
    370371
    371372    }
     
    377378            effect->setPosition(this->getPosition());
    378379            effect->setOrientation(this->getOrientation());
     380            effect->setVelocity(this->getVelocity());
    379381            effect->setDestroyAfterLife(true);
    380382            effect->setSource("Orxonox/explosion2b");
     
    385387            effect->setPosition(this->getPosition());
    386388            effect->setOrientation(this->getOrientation());
     389            effect->setVelocity(this->getVelocity());
    387390            effect->setDestroyAfterLife(true);
    388391            effect->setSource("Orxonox/smoke6");
     
    393396            effect->setPosition(this->getPosition());
    394397            effect->setOrientation(this->getOrientation());
     398            effect->setVelocity(this->getVelocity());
    395399            effect->setDestroyAfterLife(true);
    396400            effect->setSource("Orxonox/sparks");
Note: See TracChangeset for help on using the changeset viewer.