- Timestamp:
- Oct 2, 2015, 10:46:40 PM (9 years ago)
- Location:
- code/branches/towerdefenseFabien
- Files:
-
- 6 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/towerdefenseFabien/data/levels/towerDefense.oxw
r10594 r10606 220 220 </links> 221 221 <Weapon> 222 < <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0,0,0" projectileMesh="LaserBeam2.mesh"/>222 <IceGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 muzzleoffset=" 0,0,0" freezefactor=0.5 freezetime=2.0 /> 223 223 </Weapon> 224 224 </WeaponPack> -
code/branches/towerdefenseFabien/src/modules/towerdefense/TowerDefenseEnemy.h
r10586 r10606 22 22 #include "worldentities/pawns/SpaceShip.h" 23 23 #include "util/Output.h" 24 #include "controllers/ArtificialController.h"25 24 #include "TowerDefense.h" 26 25 -
code/branches/towerdefenseFabien/src/modules/weapons/CMakeLists.txt
r7163 r10606 2 2 MuzzleFlash.cc 3 3 RocketController.cc 4 IceGunFreezer.cc 4 5 ) 5 6 -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/CMakeLists.txt
r10594 r10606 8 8 SimpleRocket.cc 9 9 SplitGunProjectile.cc 10 IceGunProjectile.cc 10 11 ) -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/Projectile.cc
r10287 r10606 39 39 #include "core/command/Executor.h" 40 40 41 #include "objects/collisionshapes/SphereCollisionShape.h"42 41 #include "worldentities/pawns/Pawn.h" 43 42 … … 60 59 this->setCollisionType(Dynamic); 61 60 62 SphereCollisionShape* shape = new SphereCollisionShape(this->getContext()); 63 shape->setRadius(20.0f); 64 this->attachCollisionShape(shape); 61 // Create a sphere collision shape and attach it to the projectile. 62 collisionShape_ = new SphereCollisionShape(this->getContext()); 63 setCollisionShapeRadius(20.0f); 64 this->attachCollisionShape(collisionShape_); 65 65 66 66 this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this))); … … 76 76 SetConfigValue(lifetime_, 4.0f).description("The time in seconds a projectile stays alive"); 77 77 } 78 79 78 80 79 void Projectile::tick(float dt) … … 93 92 } 94 93 94 void Projectile::setCollisionShapeRadius(float radius) 95 { 96 if (collisionShape_ != NULL && radius > 0) 97 { 98 collisionShape_->setRadius(radius); 99 } 100 } 95 101 } -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/Projectile.h
r10216 r10606 39 39 #include "tools/Timer.h" 40 40 #include "worldentities/MovableEntity.h" 41 #include "objects/collisionshapes/SphereCollisionShape.h" 41 42 42 43 #include "BasicProjectile.h" … … 66 67 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint); 67 68 69 protected: 70 virtual void setCollisionShapeRadius(float radius); 71 68 72 private: 69 73 float lifetime_; //!< The time the projectile exists. 70 74 Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out. 75 WeakPtr<SphereCollisionShape> collisionShape_; // The collision shape of the projectile. 71 76 }; 72 77 } -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/SplitGunProjectile.cc
r10594 r10606 86 86 { 87 87 this->splitTime_ = splitTime; 88 this-> textureTimer_.setTimer(this->splitTime_, false, createExecutor(createFunctor(&SplitGunProjectile::split, this)));88 this->splitTimer_.setTimer(this->splitTime_, false, createExecutor(createFunctor(&SplitGunProjectile::split, this))); 89 89 } 90 90 else -
code/branches/towerdefenseFabien/src/modules/weapons/projectiles/SplitGunProjectile.h
r10594 r10606 28 28 29 29 /** 30 @file SplitGunProjectile.h30 @file IceGunProjectile.h 31 31 @brief Definition of the SplitGunProjectile class. 32 32 */ … … 67 67 float splitTime_; 68 68 float spread_; 69 Timer textureTimer_;69 Timer splitTimer_; 70 70 71 71 virtual void split(); -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/CMakeLists.txt
r10592 r10606 6 6 LightningGun.cc 7 7 SplitGun.cc 8 IceGun.cc 8 9 RocketFire.cc 9 10 SimpleRocketFire.cc -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.cc
r10594 r10606 28 28 29 29 /** 30 @file SplitGun. h30 @file SplitGun.cc 31 31 @brief Implementation of the SplitGun class. 32 32 */ -
code/branches/towerdefenseFabien/src/modules/weapons/weaponmodes/SplitGun.h
r10594 r10606 43 43 /** 44 44 @brief 45 A slow ball of lightning.45 A WeaponMode that fires projectiles that may split up into many other projectiles, that may again split up ... 46 46 @author 47 47 Fabien Vultier
Note: See TracChangeset
for help on using the changeset viewer.