Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12378


Ignore:
Timestamp:
May 16, 2019, 2:53:00 PM (4 months ago)
Author:
pomselj
Message:

Projectiles survive infinitely

Location:
code/branches/OrxoBlox_FS19
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi

    r12368 r12378  
    11    <weaponslots>
    2       <WeaponSlot position="-9.2,2,-13" />
    3       <WeaponSlot position=" 9.2,2,-13" />
     2      <WeaponSlot position="0,0,0" />/>
    43    </weaponslots>
    54    <weaponsets>
    65      <WeaponSet firemode=0 />
    7       <WeaponSet firemode=1 />
    86    </weaponsets>
    97    <weaponpacks>
     
    119        <links>
    1210          <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
    13           <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
    1411        </links>
    1512        <Weapon>
    1613          <BallGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
    17         </Weapon>
    18         <Weapon>
    19           <BallGun mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
    2014        </Weapon>
    2115      </WeaponPack>
  • code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw

    r12373 r12378  
    5555        <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
    5656      </attached>
     57      <collisionShapes>
     58                <BoxCollisionShape position="0,0,0" halfExtents="4.5, 4.5, 4.5" />
     59      </collisionShapes>
    5760    </OrxoBloxStones>
    5861  </Template>
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc

    r12376 r12378  
    104104        Vector3 myPosition = otherObject->getPosition();
    105105        btVector3 positionOtherObject = contactPoint.getPositionWorldOnA();
    106         //orxout() << "About to Bounce >D" << endl;
    107         //if (positionOtherObject.y < 0) {
    108             //this.destroy()
    109         //}S
    110         //else {
    111106       
    112107            int distance_X = positionOtherObject.getX() - myPosition.x;
     
    143138    bool BallProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
    144139    {
    145 
    146         //orxout() << "wanna bounce..." << endl;
    147140        bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
    148141        if (result == true) {
    149142            if (otherObject->isA(Class(OrxoBloxStones))) {
    150143                Bounce(otherObject, contactPoint, cs);
    151             }
    152         }
    153         //orxout() << "BOUNCED!" << endl;
    154 
     144                orxout() << "BOUNCED!" << endl;
     145            }
     146        }
    155147        return result;
    156148    }
     
    289281    }
    290282
     283    void BallProjectile::destroyObject(void)
     284    {
     285        if(GameMode::isMaster()) {
     286        }
     287    }
     288
     289
    291290
    292291}
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h

    r12368 r12378  
    6565
    6666        private:
    67 
     67            void destroyObject() override;
    6868            void registerVariables();
    6969            void changeTexture();
  • code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc

    r12376 r12378  
    8585    bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
    8686    {
    87         //orxout() << "OMG A COLLISION" << endl;
    8887        if (!this->bDestroy_ && GameMode::isMaster())
    8988        {
     
    9392            if (getDestroyAfterCollision())
    9493            {
     94                orxout() << "Destroy that stuff" << endl;
    9595                this->bDestroy_ = true; // If something is hit, the object is destroyed and can't hit something else.
    9696                                        // The projectile is destroyed by its tick()-function (in the following tick).
     
    173173    void BasicProjectile::destroyCheck(void)
    174174    {
    175         if(GameMode::isMaster() && this->bDestroy_)
     175        if(GameMode::isMaster() && this->bDestroy_) {
     176            orxout() << "Set true, smhow" << endl;
    176177            this->destroy();
     178        }
    177179    }
    178180
     
    183185    void BasicProjectile::destroyObject(void)
    184186    {
    185         if(GameMode::isMaster())
     187        if(GameMode::isMaster()) {
     188            orxout() << "Deleted myself" << endl;
    186189            this->destroy();
     190        }
    187191    }
    188192}
  • code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc

    r12371 r12378  
    6060        this->reloadTime_ = 0.25f;
    6161        this->damage_ = 0.0f; //default 15
    62         this->speed_ = 50;
     62        this->speed_ = 100;
    6363        this->delay_ = 100;
    6464        this->setMunitionName("BallMunition");
     
    104104    void BallGun::fire()
    105105    {
    106         orxout() << "fire" << endl;
    107106        this->delayTimer_.startTimer();
    108107    }
     
    115114    {
    116115        assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
    117         orxout() << "SHOT!" << endl;
    118116        // Create the projectile.
    119117        Projectile* projectile = new BallProjectile(this->getContext());
Note: See TracChangeset for help on using the changeset viewer.