[Orxonox-commit 6978] r11599 - in code/branches/SOBv2_HS17: data/levels src/modules/superorxobros
varxth at orxonox.net
varxth at orxonox.net
Mon Nov 27 15:28:41 CET 2017
Author: varxth
Date: 2017-11-27 15:28:41 +0100 (Mon, 27 Nov 2017)
New Revision: 11599
Modified:
code/branches/SOBv2_HS17/data/levels/SOB.oxw
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h
Log:
fireball with particle spawner
Modified: code/branches/SOBv2_HS17/data/levels/SOB.oxw
===================================================================
--- code/branches/SOBv2_HS17/data/levels/SOB.oxw 2017-11-27 14:00:47 UTC (rev 11598)
+++ code/branches/SOBv2_HS17/data/levels/SOB.oxw 2017-11-27 14:28:41 UTC (rev 11599)
@@ -56,7 +56,7 @@
</attached>
<collisionShapes>
- <BoxCollisionShape position="-2,0,2" halfExtents="3,1,10" />
+ <BoxCollisionShape position="0,0,2" halfExtents="3,1,10" />
</collisionShapes>
@@ -69,6 +69,8 @@
<attached>
<Model mesh="planets/sol.mesh" position="0,0,0" scale=3 pitch=90/>
+ <ParticleSpawner source="Orxonox/fire4" startdelay=0 position="-4,0,0" visible="false"/>
+
</attached>
<collisionShapes>
<SphereCollisionShape position="0,0,0" radius="3" />
Modified: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc 2017-11-27 14:00:47 UTC (rev 11598)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFigure.cc 2017-11-27 14:28:41 UTC (rev 11599)
@@ -22,6 +22,8 @@
* Author:
* Julien Kindle
* Co-authors:
+ * Noah Zarro
+ * Theo von Arx
*
*
*/
@@ -159,6 +161,9 @@
}
else if (fireball != nullptr && !(fireball->hasCollided_)){
+ if(PowerUpCounter_ == 0){
+ this->die();
+ }
PowerUpCounter_--;
this->changeClothes();
}
@@ -231,7 +236,9 @@
if (object->isA(Class(ParticleSpawner)))
particlespawner_ = object;
}
+
}
+
//Behavior on level end - this is like described above for the movement from the player when hit the flag. He moves then into the castle
@@ -299,12 +306,12 @@
particlespawner_->setVisible(true);
else
particlespawner_->setVisible(false);
+
-
//If player hits space and collides against an object under him then jump
if (inputAllowed && firePressed_ && isColliding_ && (collDisZ_ >= 0 && collDisZ_ <+ 10)) {
- gravityAcceleration_ = 100.0;
- velocity.z = 110;
+ gravityAcceleration_ = 350;
+ velocity.z = 175;
}
Modified: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc 2017-11-27 14:00:47 UTC (rev 11598)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.cc 2017-11-27 14:28:41 UTC (rev 11599)
@@ -41,9 +41,11 @@
#include "SOB.h"
#include "util/Output.h"
#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
+#include "graphics/ParticleSpawner.h"
+
namespace orxonox
{
RegisterClass(SOBFireball);
@@ -57,6 +59,7 @@
figure_ = nullptr;
this->enableCollisionCallback();
gravityAcceleration_ = 350.0;
+
speed_ = 0;
hasCollided_=false;
lastPos_ = getPosition();
@@ -67,7 +70,12 @@
collDisX_ = 0;
collDisZ_ = 0;
hitCounter_ = 0;
-
+ particlespawner_ = NULL ;
+
+
+
+
+
}
@@ -146,6 +154,18 @@
{
SUPER(SOBFireball, tick, dt);
+ //the particle spawner that generates the fire from the backpack when pressed
+ if (particlespawner_ == NULL) {
+ for (WorldEntity* object : this->getAttachedObjects())
+ {
+ if (object->isA(Class(ParticleSpawner)))
+ particlespawner_ = object;
+ }
+
+ }
+
+ if(particlespawner_ != NULL)
+ particlespawner_->setVisible(true);
if (!changeAllowed_) {
changedOn_+= dt;
// After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions!
Modified: code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h
===================================================================
--- code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h 2017-11-27 14:00:47 UTC (rev 11598)
+++ code/branches/SOBv2_HS17/src/modules/superorxobros/SOBFireball.h 2017-11-27 14:28:41 UTC (rev 11599)
@@ -71,6 +71,8 @@
bool changeAllowed_;
float changedOn_;
int hitCounter_;
+ WorldEntity* particlespawner_;
+
More information about the Orxonox-commit
mailing list