Changeset 3685 in orxonox.OLD for orxonox/trunk/src/world_entities
- Timestamp:
- Mar 30, 2005, 11:04:39 PM (20 years ago)
- Location:
- orxonox/trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r3683 r3685 156 156 void Player::tick (float time) 157 157 { 158 /* link tick to weapon */ 159 this->activeWeapon->tick(time); 158 160 // player controlled movement 159 161 this->move(time); -
orxonox/trunk/src/world_entities/projectile.cc
r3683 r3685 37 37 this->flightDirection = NULL; 38 38 this->currentLifeTime = 0.0f; 39 this->ttl = 1.0f;39 this->ttl = 0.75f; /* sec */ 40 40 this->speed = 2.0f; 41 41 } … … 89 89 void Projectile::setSpeed(float speed) 90 90 { 91 this->speed = speed * 5;92 printf("Projectile::setting speed to: %f\n", this->speed);91 this->speed = speed * 3; 92 PRINTF(4)("Projectile::setting speed to: %f\n", this->speed); 93 93 } 94 94 … … 99 99 void Projectile::tick (float time) 100 100 { 101 this->speed = this->weapon->getSpeed() * 5;101 this->speed = this->weapon->getSpeed() * 3; 102 102 this->shiftCoor(*this->flightDirection * this->speed * time); 103 printf("current speed is: %f\n", this->speed);103 //printf("current speed is: %f\n", this->speed); 104 104 105 105 this->currentLifeTime += time; 106 if( this->ttl > this->currentLifeTime) 107 this->finalize(); 106 if( this->ttl < this->currentLifeTime) 107 { 108 PRINTF(5)("FINALIZE=============================================================\n"); 109 PRINTF(5)("current life time is: %f/%f\n", this->currentLifeTime, this->ttl); 110 PRINTF(5)("FINALIZE=============================================================\n"); 111 this->finalize(); 112 } 108 113 } 109 114 -
orxonox/trunk/src/world_entities/test_gun.cc
r3683 r3685 42 42 : Weapon (parent, coordinate, direction) 43 43 { 44 this->idleTime = 0.2f; 44 45 } 45 46 … … 83 84 void TestGun::fire() 84 85 { 85 //printf("TestGun::fire() - firing weapon now ---------------------------\n"); 86 if( this->localTime < this->idleTime) 87 return; 88 86 89 Projectile* pj = new Projectile(this); 87 90 … … 96 99 pj->setSpeed(this->getSpeed()); 97 100 98 99 100 101 this->worldEntities->add(pj); 102 this->localTime = 0; 101 103 } 102 104 … … 128 130 */ 129 131 void TestGun::tick (float time) 130 {} 132 { 133 this->localTime += time; 134 } 131 135 132 136 -
orxonox/trunk/src/world_entities/weapon.cc
r3677 r3685 154 154 */ 155 155 void Weapon::setWeaponIdleTime(float time) 156 {} 156 { 157 this->idleTime = time; 158 } 157 159 158 160 /** … … 164 166 */ 165 167 float Weapon::getWeaponIdleTime(void) 166 {} 168 { 169 return this->idleTime; 170 } 167 171 168 172 /** … … 174 178 */ 175 179 bool Weapon::hasWeaponIdleTimeElapsed(void) 176 {} 180 { 181 return (this->localTime>this->idleTime)?true:false; 182 } 177 183 178 184 -
orxonox/trunk/src/world_entities/weapon.h
r3646 r3685 71 71 protected: 72 72 tList<WorldEntity>* worldEntities; 73 float localTime; 74 float idleTime; 75 float slowDownFactor; 73 76 74 77 private: 75 78 bool enabled; 76 float localTime;77 float slowDownFactor;78 79 Projectile* projectile; 79 80 //WeaponSound sound;
Note: See TracChangeset
for help on using the changeset viewer.