[Orxonox-commit 7757] r12349 - code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
ahuwyler at orxonox.net
ahuwyler at orxonox.net
Thu May 9 13:33:42 CEST 2019
Author: ahuwyler
Date: 2019-05-09 13:33:42 +0200 (Thu, 09 May 2019)
New Revision: 12349
Modified:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
Log:
cleanup active Walls
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-09 10:32:44 UTC (rev 12348)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc 2019-05-09 11:33:42 UTC (rev 12349)
@@ -108,10 +108,15 @@
if (this->futureWall_)
{
- this->futureWall_->destroy();
- this->futureWall_ = nullptr;
+ this->futureWall_->destroy();
+ this->futureWall_ = nullptr;
}
+ for (OrxoBloxWall* wall : this->activeWalls_)
+ wall->destroy();
+ this->activeWalls_.clear();
+
+
for (OrxoBloxStones* stone : this->stones_)
stone->destroy();
this->stones_.clear();
@@ -146,7 +151,7 @@
level_=1;
// Create the first Wall.
- this->createWall();
+ this->LevelUp();
//Create Ship
//this->ship_ = new OrxoBloxShip(this->center_->getContext());
@@ -211,7 +216,16 @@
void OrxoBlox::LevelUp(){
level_++;
this->createWall();
+
+ for(OrxoBloxWall* Wall : this->activeWalls_){
+ int x_=(Wall->getPosition()).x;
+ orxout()<<x_<<endl;
+ Wall->setPosition(0,0,x_+10.0f);
+ }
+
this->activeWalls_.push_back(this->futureWall_);
+
+
for (int i = 0; i < this->futureWall_->getNumberOfStones(); i++)
this->stones_.push_back(this->futureWall_->getStone(i));
//new location of ship
@@ -243,7 +257,7 @@
this->ball_->setSpeed(this->center_->getBallSpeed());
}
- OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {
+ /*OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {
orxout() << "Checking for Collision" << endl;
Vector3 BallPosition = Ball->getPosition();
@@ -260,6 +274,6 @@
}
orxout() << "Found nothing...." << endl;
return nullptr;
- }
+ }*/
}
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc 2019-05-09 10:32:44 UTC (rev 12348)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc 2019-05-09 11:33:42 UTC (rev 12349)
@@ -149,7 +149,10 @@
// Set the ball to be exactly at the boundary.
position.z = this-> fieldHeight_ / 2;
// Set the velocity to zero
+
+ orxoblox_->LevelUp();
+
//this->setSpeed(0); // doesn't work here, why??;
//Stopping ball
orxout() << "Ball stopped" << endl;
@@ -208,7 +211,7 @@
this->setVelocity(velocity);
if (position != this->getPosition())
this->setPosition(position);
- this->Collides((this->orxoblox_->CheckForCollision(this)));
+ //this->Collides((this->orxoblox_->CheckForCollision(this)));
}
Modified: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h 2019-05-09 10:32:44 UTC (rev 12348)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h 2019-05-09 11:33:42 UTC (rev 12349)
@@ -150,7 +150,7 @@
WorldSound* defBatSound_;
WorldSound* defBoundarySound_;
OrxoBlox* orxoblox_;
- OrxoBlox* getOrxoBlox();
+
};
}
More information about the Orxonox-commit
mailing list