[Orxonox-commit 5221] r9884 - in code/branches/invaders: data/levels src/modules/invader
zifloria at orxonox.net
zifloria at orxonox.net
Mon Dec 9 14:53:58 CET 2013
Author: zifloria
Date: 2013-12-09 14:53:57 +0100 (Mon, 09 Dec 2013)
New Revision: 9884
Modified:
code/branches/invaders/data/levels/Invaders.oxw
code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc
code/branches/invaders/src/modules/invader/InvaderShip.cc
Log:
finito! (apart from explosions)
Modified: code/branches/invaders/data/levels/Invaders.oxw
===================================================================
--- code/branches/invaders/data/levels/Invaders.oxw 2013-12-09 13:28:00 UTC (rev 9883)
+++ code/branches/invaders/data/levels/Invaders.oxw 2013-12-09 13:53:57 UTC (rev 9884)
@@ -31,6 +31,12 @@
skybox = "Orxonox/skyBoxBasic"
>
+ <WorldAmbientSound
+ source="Earth.ogg"
+ looping="true"
+ playOnLoad="true"
+ />
+
<!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
<Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=InvaderShip pawndesign=spaceshipinvader />
Modified: code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc 2013-12-09 13:28:00 UTC (rev 9883)
+++ code/branches/invaders/src/modules/invader/InvaderHUDinfo.cc 2013-12-09 13:53:57 UTC (rev 9884)
@@ -73,7 +73,7 @@
if (this->InvaderGame->lives <= 0)
{
setPosition(Vector2(0.1, 0.65));
- this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart press space.");
+ this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart fly out of the screen!");
setTextSize(0.05);
this->InvaderGame->bEndGame = true;
}
Modified: code/branches/invaders/src/modules/invader/InvaderShip.cc
===================================================================
--- code/branches/invaders/src/modules/invader/InvaderShip.cc 2013-12-09 13:28:00 UTC (rev 9883)
+++ code/branches/invaders/src/modules/invader/InvaderShip.cc 2013-12-09 13:53:57 UTC (rev 9884)
@@ -70,7 +70,16 @@
if(dist_y + posforeward > -42*3 && dist_y + posforeward < 42*6)
posforeward += dist_y;
else
+ {
velocity.y = 0;
+ // restart if game ended
+ if (getGame())
+ if (getGame()->bEndGame)
+ {
+ getGame()->start();
+ return;
+ }
+ }
if (pos.z + dist_x > 42*2.5 || pos.z + dist_x < -42*3)
velocity.x = 0;
pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
@@ -128,10 +137,6 @@
void InvaderShip::boost(bool bBoost)
{
isFireing = bBoost;
- // restart if game ended
- if (getGame())
- if (getGame()->bEndGame)
- getGame()->start();
}
inline bool InvaderShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
{
More information about the Orxonox-commit
mailing list