Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2017, 3:28:41 PM (7 years ago)
Author:
varxth
Message:

fireball with particle spawner

Location:
code/branches/SOBv2_HS17/src/modules/superorxobros
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc

    r11597 r11599  
    2323 *      Julien Kindle
    2424 *   Co-authors:
     25 *      Noah Zarro
     26 *      Theo von Arx
    2527 *     
    2628 *
     
    160162
    161163        else if (fireball != nullptr && !(fireball->hasCollided_)){
     164            if(PowerUpCounter_ == 0){
     165                    this->die();
     166                }
    162167            PowerUpCounter_--;
    163168            this->changeClothes();
     
    232237            particlespawner_ = object;
    233238        }
    234     }
     239
     240    }
     241   
    235242
    236243
     
    300307        else
    301308            particlespawner_->setVisible(false);
    302 
     309       
    303310
    304311        //If player hits space and collides against an object under him then jump
    305312        if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 0 && collDisZ_ <+ 10)) {
    306             gravityAcceleration_ = 100.0;
    307             velocity.z = 110;
     313            gravityAcceleration_ = 350;
     314            velocity.z = 175;
    308315        }
    309316
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc

    r11597 r11599  
    4242#include "util/Output.h"
    4343#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     44#include "graphics/ParticleSpawner.h"
     45
    4446
    4547
     
    5860        this->enableCollisionCallback();
    5961        gravityAcceleration_ = 350.0;
     62
    6063        speed_ = 0;
    6164        hasCollided_=false;
     
    6871        collDisZ_ = 0;
    6972        hitCounter_ = 0;
    70        
     73        particlespawner_ = NULL ;
     74
     75
     76
     77   
     78
    7179    }
    7280
     
    147155        SUPER(SOBFireball, tick, dt);
    148156
     157        //the particle spawner that generates the fire from the backpack when pressed
     158        if (particlespawner_ == NULL) {
     159            for (WorldEntity* object : this->getAttachedObjects())
     160            {
     161               if (object->isA(Class(ParticleSpawner)))
     162                particlespawner_ = object;
     163            }
     164
     165        }
     166
     167        if(particlespawner_ != NULL)
     168            particlespawner_->setVisible(true);
    149169        if (!changeAllowed_) {
    150170            changedOn_+= dt;
  • code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h

    r11577 r11599  
    7272            float changedOn_;
    7373            int hitCounter_;
     74            WorldEntity* particlespawner_;
     75
    7476 
    7577
Note: See TracChangeset for help on using the changeset viewer.