Changeset 11083 for code/trunk/src/modules/invader
- Timestamp:
- Jan 21, 2016, 1:59:04 PM (9 years ago)
- Location:
- code/trunk/src/modules/invader
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/invader/Invader.cc
r11071 r11083 129 129 newPawn->addTemplate("enemyinvader"); 130 130 } 131 newPawn->set Player(player);131 newPawn->setInvaderPlayer(player); 132 132 newPawn->level = level; 133 133 // spawn enemy at random points in front of player. -
code/trunk/src/modules/invader/InvaderEnemy.cc
r11071 r11083 58 58 if (player != nullptr) 59 59 { 60 float newZ = 2/(pow( abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z);60 float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * (player->getPosition().z - getPosition().z); 61 61 setVelocity(Vector3(1000.f - level * 100 , 0, newZ)); 62 62 } -
code/trunk/src/modules/invader/InvaderEnemy.h
r11071 r11083 49 49 virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override; 50 50 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator, const btCollisionShape* cs) override; 51 virtual void set Player(InvaderShip* player){this->player = player;}51 virtual void setInvaderPlayer(InvaderShip* player){this->player = player;} 52 52 53 53 int level; -
code/trunk/src/modules/invader/InvaderEnemyShooter.cc
r11071 r11083 63 63 float distPlayer = player->getPosition().z - getPosition().z; 64 64 // orxout() << "i'm different!" << endl; 65 float newZ = 2/(pow( abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer;66 setVelocity(Vector3(950 - abs(distPlayer), 0, newZ));65 float newZ = 2/(pow(std::abs(getPosition().x - player->getPosition().x) * 0.01f, 2) + 1) * distPlayer; 66 setVelocity(Vector3(950 - std::abs(distPlayer), 0, newZ)); 67 67 } 68 68 Pawn::tick(dt);
Note: See TracChangeset
for help on using the changeset viewer.