Changeset 9961 for code/trunk/src/modules
- Timestamp:
- Jan 3, 2014, 9:20:39 PM (11 years ago)
- Location:
- code/trunk/src/modules/invader
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/invader/Invader.cc
r9959 r9961 88 88 { 89 89 WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext()); 90 chunk->setPosition(Vector3(600, 0, 100 * i - 300));90 chunk->setPosition(Vector3(600, 0, 100.f * i - 300)); 91 91 chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity() 92 92 chunk->setScale(20); … … 130 130 newPawn->level = level; 131 131 // spawn enemy at random points in front of player. 132 newPawn->setPosition(player->getPosition() + Vector3(500 + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));132 newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200)); 133 133 } 134 134 } -
code/trunk/src/modules/invader/InvaderEnemy.cc
r9943 r9961 56 56 if (player != NULL) 57 57 { 58 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01 , 2) + 1) * (player->getPosition().z - getPosition().z);59 setVelocity(Vector3(1000 - level * 100 , 0, newZ));58 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); 59 setVelocity(Vector3(1000.f - level * 100 , 0, newZ)); 60 60 } 61 61 SUPER(InvaderEnemy, tick, dt); -
code/trunk/src/modules/invader/InvaderEnemyShooter.cc
r9943 r9961 60 60 float distPlayer = player->getPosition().z - getPosition().z; 61 61 // orxout() << "i'm different!" << endl; 62 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01 , 2) + 1) * distPlayer;62 float newZ = 2/(pow(abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer; 63 63 setVelocity(Vector3(950 - abs(distPlayer), 0, newZ)); 64 64 } -
code/trunk/src/modules/invader/InvaderHUDinfo.cc
r9943 r9961 117 117 this->setCaption(Multiplier); 118 118 this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f))); 119 this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01 + 0.04);119 this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01f + 0.04f); 120 120 } 121 121 } -
code/trunk/src/modules/invader/InvaderWeapon.cc
r9943 r9961 73 73 this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition()); 74 74 // only shoot in foreward direction 75 projectile->setOrientation(Quaternion(sqrt(0.5 ),0,sqrt(0.5),0));75 projectile->setOrientation(Quaternion(sqrt(0.5f),0,sqrt(0.5f),0)); 76 76 projectile->setPosition(this->getMuzzlePosition()); 77 77 // only shoot in foreward direction
Note: See TracChangeset
for help on using the changeset viewer.