Index: /code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- /code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw (revision 12370)
+++ /code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw (revision 12371)
@@ -93,5 +93,5 @@
-
+
Index: /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/CMakeLists.txt (revision 12371)
@@ -3,5 +3,4 @@
OrxoBlox.cc
OrxoBloxWall.cc
- OrxoBloxBall.cc
OrxoBloxCenterpoint.cc
OrxoBloxStones.cc
Index: /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc (revision 12371)
@@ -48,5 +48,4 @@
#include "OrxoBloxCenterpoint.h"
-#include "OrxoBloxBall.h"
#include "OrxoBloxStones.h"
#include "OrxoBloxWall.h"
@@ -68,5 +67,5 @@
this->center_ = nullptr;
- this->ball_ = nullptr;
+ //this->ball_ = nullptr;
this->futureWall_ = nullptr;
this->player_ = nullptr;
@@ -77,5 +76,5 @@
// Pre-set the timer, but don't start it yet.
- this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&OrxoBlox::startBall, this)));
+ this->starttimer_.setTimer(1.0, false, createExecutor(createFunctor(&OrxoBlox::LevelUp, this)));
this->starttimer_.stopTimer();
@@ -100,9 +99,9 @@
void OrxoBlox::cleanup()
{
- if (this->ball_ != nullptr) // Destroy the ball, if present.
- {
- this->ball_->destroy();
- this->ball_ = nullptr;
- }
+ //if (this->ball_ != nullptr) // Destroy the ball, if present.
+ //{
+ // this->ball_->destroy();
+ // this->ball_ = nullptr;
+ //}
if (this->futureWall_ != nullptr)
@@ -135,18 +134,18 @@
if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
{
- if (this->ball_ == nullptr) // If there is no ball, create a new ball.
- {
- this->ball_ = new OrxoBloxBall(this->center_->getContext());
+ //if (this->ball_ == nullptr) // If there is no ball, create a new ball.
+ //{
+ // this->ball_ = new OrxoBloxBall(this->center_->getContext());
// Apply the template for the ball specified by the centerpoint.
- this->ball_->addTemplate(this->center_->getBalltemplate());
- }
+ // this->ball_->addTemplate(this->center_->getBalltemplate());
+ //}
// Attach the ball to the centerpoint and set the parameters as specified in the centerpoint, the ball is attached to.
- this->center_->attach(this->ball_);
+ //this->center_->attach(this->ball_);
//Startposition Ball
- this->ball_->setPosition(0, 0, 40);
- this->ball_->setFieldDimension(this->center_->getFieldDimension());
- this->ball_->setSpeed(0);
- this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
+ //this->ball_->setPosition(0, 0, 40);
+ //this->ball_->setFieldDimension(this->center_->getFieldDimension());
+ //this->ball_->setSpeed(0);
+ //this->ball_->setAccelerationFactor(this->center_->getBallAccelerationFactor());
level_=1;
@@ -286,12 +285,11 @@
Starts the ball with some default speed.
*/
- void OrxoBlox::startBall()
- {
- if (this->ball_ != nullptr && this->center_ != nullptr)
- this->ball_->setSpeed(this->center_->getBallSpeed());
- }
+ //void OrxoBlox::startBall()
+ //{
+ // if (this->ball_ != nullptr && this->center_ != nullptr)
+ // 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();
@@ -314,4 +312,5 @@
return nullptr;
}
+ */
void OrxoBlox::playerPreSpawn(PlayerInfo* player)
Index: /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h (revision 12371)
@@ -89,5 +89,5 @@
OrxoBloxCenterpoint* getCenterpoint(void)
{ return this->center_; }
- OrxoBloxStones* CheckForCollision(OrxoBloxBall* Ball);
+ //OrxoBloxStones* CheckForCollision(OrxoBloxBall* Ball);
virtual void addBots(unsigned int amount) override{} // center_; //!< The playing field.
- WeakPtr ball_; //!< The OrxoBlox ball.
+ //WeakPtr ball_; //!< The OrxoBlox ball.
unsigned int level_;
Index: /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h (revision 12371)
@@ -69,5 +69,5 @@
{
class OrxoBlox;
- class OrxoBloxBall;
+ //class OrxoBloxBall;
class OrxoBloxCenterpoint;
class OrxoBloxWall;
Index: /code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc (revision 12371)
@@ -34,4 +34,5 @@
#include "BallProjectile.h"
#include "../OrxoBlox/OrxoBlox.h"
+#include "../OrxoBlox/OrxoBloxStones.h"
#include "gametypes/Gametype.h"
@@ -57,4 +58,6 @@
this->maxTextureIndex_ = 8;
this->setDestroyAfterCollision(false); //I want the ball to bounce, not to be destroyed
+ this->fieldWidth_ = 46;
+ this->fieldHeight_ = 49;
//this->orxoblox_ = this->getOrxoBlox();
@@ -64,6 +67,4 @@
void BallProjectile::registerVariables()
{
- registerVariable( this->fieldWidth_ );
- registerVariable( this->fieldHeight_ );
registerVariable(this->materialBase_);
registerVariable( this->speed_ );
@@ -145,5 +146,9 @@
orxout() << "wanna bounce..." << endl;
bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
- Bounce(otherObject, contactPoint, cs);
+ if (result == true) {
+ if (otherObject->isA(Class(OrxoBloxStones))) {
+ Bounce(otherObject, contactPoint, cs);
+ }
+ }
orxout() << "BOUNCED!" << endl;
@@ -175,13 +180,16 @@
Vector3 acceleration = this->getAcceleration();
+ velocity.y = 0;
+ position.y = 0;
+
// If the ball has gone over the top or bottom boundary of the playing field (i.e. the ball has hit the top or bottom delimiters).
- if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
+ if (position.z > this->fieldHeight_ || position.z < -this->fieldHeight_)
{
velocity.z = -velocity.z;
// And its position is set as to not overstep the boundary it has just crossed. Remember z axis is reverted!!!
- if (position.z > this->fieldHeight_ / 2){
+ if (position.z > this->fieldHeight_){
// Set the ball to be exactly at the boundary.
- position.z = this-> fieldHeight_ / 2;
+ position.z = this-> fieldHeight_;
//orxoblox_->LevelUp();
@@ -218,6 +226,6 @@
}
- if (position.z < -this->fieldHeight_ / 2){
- position.z = -this->fieldHeight_ / 2 ;
+ if (position.z < -this->fieldHeight_){
+ position.z = -this->fieldHeight_;
}
@@ -228,11 +236,11 @@
//Ball hits the right or left wall and should bounce back.
// If the ball has crossed the left or right boundary of the playing field.
- if (position.x > this->fieldWidth_ / 2 || position.x < -this->fieldWidth_ / 2)
+ if (position.x > this->fieldWidth_ || position.x < -this->fieldWidth_)
{
//Ball hits the right Wall
- if (position.x > this->fieldWidth_ / 2)
+ if (position.x > this->fieldWidth_)
{
// Set the ball to be exactly at the boundary.
- position.x = this->fieldWidth_ / 2;
+ position.x = this->fieldWidth_;
// Invert its velocity in x-direction (i.e. it bounces off).
velocity.x = -velocity.x;
@@ -241,8 +249,8 @@
//Ball hits the left wall
- else if (position.x < -this->fieldWidth_ / 2)
+ else if (position.x < -this->fieldWidth_)
{
// Set the ball to be exactly at the boundary.
- position.x = -this->fieldWidth_ / 2;
+ position.x = -this->fieldWidth_;
// Invert its velocity in x-direction (i.e. it bounces off).
velocity.x = -velocity.x;
Index: /code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc
===================================================================
--- /code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc (revision 12370)
+++ /code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc (revision 12371)
@@ -34,4 +34,5 @@
#include "BallGun.h"
+
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
@@ -59,6 +60,6 @@
this->reloadTime_ = 0.25f;
this->damage_ = 0.0f; //default 15
- this->speed_ = 750.0f;
- this->delay_ = 0.0f;
+ this->speed_ = 50;
+ this->delay_ = 100;
this->setMunitionName("BallMunition");
this->mesh_ = "laserbeam.mesh";