[Orxonox-commit 7792] r12384 - in code/branches/OrxoBlox_FS19/src/modules: OrxoBlox weapons/projectiles weapons/weaponmodes
pomselj at orxonox.net
pomselj at orxonox.net
Thu May 16 16:03:46 CEST 2019
Author: pomselj
Date: 2019-05-16 16:03:46 +0200 (Thu, 16 May 2019)
New Revision: 12384
Modified:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/CMakeLists.txt
code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/CMakeLists.txt
Log:
OrxoBlox is linked to Projectile, level up works
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt 2019-05-16 14:03:46 UTC (rev 12384)
@@ -6,6 +6,8 @@
OrxoBloxStones.cc
OrxoBloxScore.cc
OrxoBloxShip.cc
+ ../weapons/weaponmodes/BallGun.cc
+ ../weapons/projectiles/BallProjectile.cc
)
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-16 14:03:46 UTC (rev 12384)
@@ -229,17 +229,9 @@
orxout() << "level up called" << endl;
this->playerScored(this->player_);// add points
- for(OrxoBloxStones* stone : this->stones_){
- int x_=(stone->getPosition()).x;
- int y_=(stone->getPosition()).y;
- z_=(stone->getPosition()).z;
- //if(z_==90)this->end();
+
- stone->setPosition(x_,y_,z_+9.0f);
-
- }
-
this->createWall();
this->activeWalls_.push_back(this->futureWall_);
for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++) {
@@ -269,10 +261,22 @@
//new amount of balls
//create balls
//insert new wall
- if( z_ >= 45){
- orxout() << "calling end() function" << endl;
- this->end();
+ for(OrxoBloxStones* stone : this->stones_){
+ if (stone != nullptr) {
+ int x_=(stone->getPosition()).x;
+ int y_=(stone->getPosition()).y;
+ z_=(stone->getPosition()).z;
+ //if(z_==90)this->end();
+
+ stone->setPosition(x_,y_,z_+9.0f);
+ if( z_ >= 45){
+ orxout() << "calling end() function" << endl;
+ this->end();
}
+ }
+
+ }
+
}
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc 2019-05-16 14:03:46 UTC (rev 12384)
@@ -32,8 +32,6 @@
*/
#include "BallProjectile.h"
-#include "../OrxoBlox/OrxoBlox.h"
-#include "../OrxoBlox/OrxoBloxStones.h"
#include "gametypes/Gametype.h"
@@ -59,7 +57,7 @@
this->setDestroyAfterCollision(false); //I want the ball to bounce, not to be destroyed
this->fieldWidth_ = 46;
this->fieldHeight_ = 49;
- //this->orxoblox_ = this->getOrxoBlox();
+ this->orxoblox_ = this->getOrxoBlox();
//setEffect("Orxonox/sparks2");
}
@@ -148,7 +146,7 @@
}
- /*
+
OrxoBlox* BallProjectile::getOrxoBlox()
{
if (this->getGametype() != nullptr && this->getGametype()->isA(Class(OrxoBlox)))
@@ -159,7 +157,7 @@
else orxout()<<"There is no Gametype for OrxoBlox! ask Anna"<< endl;
return nullptr;
}
- */
+
void BallProjectile::tick(float dt)
@@ -184,7 +182,7 @@
// Set the ball to be exactly at the boundary.
position.z = this-> fieldHeight_;
- //orxoblox_->LevelUp();
+ orxoblox_->LevelUp();
//this->setSpeed(0); // doesn't work here, why??;
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h 2019-05-16 14:03:46 UTC (rev 12384)
@@ -36,7 +36,8 @@
#include "weapons/WeaponsPrereqs.h"
#include "weapons/projectiles/BillboardProjectile.h"
-#include "../OrxoBlox/OrxoBlox.h"
+#include "../../OrxoBlox/OrxoBlox.h"
+#include "../../OrxoBlox/OrxoBloxStones.h"
#include "OrxoBlox/OrxoBloxPrereqs.h"
@@ -67,7 +68,7 @@
void destroyObject() override;
void registerVariables();
void changeTexture();
- //OrxoBlox* getOrxoBlox();
+ OrxoBlox* getOrxoBlox();
float speed_; //!< The speed (in x-direction) of the ball.
float fieldWidth_; //!< The width of the playing field.
@@ -75,7 +76,7 @@
unsigned int textureIndex_; //!< The current index of the texture. (i.e. the index of the currently displayed texture)
unsigned int maxTextureIndex_; //!< The maximal index.
std::string materialBase_; //!< The base name of the material.
- //OrxoBlox* orxoblox_;
+ OrxoBlox* orxoblox_;
};
}
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/CMakeLists.txt 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/CMakeLists.txt 2019-05-16 14:03:46 UTC (rev 12384)
@@ -14,5 +14,5 @@
GravityBombField.cc
MineProjectile.cc
WagnisProjectile.cc
- BallProjectile.cc
+ #BallProjectile.cc
)
Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/CMakeLists.txt 2019-05-16 13:58:40 UTC (rev 12383)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/CMakeLists.txt 2019-05-16 14:03:46 UTC (rev 12384)
@@ -13,5 +13,5 @@
GravityBombFire.cc
MineGun.cc
WagnisGun.cc
- BallGun.cc
+ #BallGun.cc
)
More information about the Orxonox-commit
mailing list