Index: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	(revision 12367)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc	(revision 12368)
@@ -106,5 +106,5 @@
         }
 
-        if (this->futureWall_)
+        if (this->futureWall_ != nullptr)
             {
             this->futureWall_->destroy();
@@ -113,4 +113,5 @@
 
         for (OrxoBloxWall* wall : this->activeWalls_)
+            if (wall != nullptr)
             wall->destroy();
         this->activeWalls_.clear();
@@ -118,4 +119,5 @@
 
         for (OrxoBloxStones* stone : this->stones_)
+            if(stone != nullptr)
             stone->destroy();
         this->stones_.clear();
@@ -285,5 +287,5 @@
             this->ball_->setSpeed(this->center_->getBallSpeed());
     }
-
+     
     OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {
 
@@ -314,3 +316,26 @@
     }
     
+/*
+    bool OrxoBlox::Intersect(int XpositionBall, int XPositionBlock, int YPositionBall, int YPositionBlock, int radiusBall, int sizeBlock) {
+        distanceX = XpositionBall - XPositionBlock;
+        distanceY = YPositionBall - YPositionBlock;
+        if (distanceX < 0) {
+            distanceX = -distanceX;
+        }
+        if (distanceY < 0) {
+            distanceY = -distanceY;
+        }
+        if((distanceX <= radiusBall + sizeBlock) || (distanceY <= radiusBall + sizeBlock)) {
+            return true;
+        }
+        else {
+            top = YPositionBall + radiusBall;
+            right = XpositionBall + radiusBall;
+            bottom = YPositionBall - radiusBall;
+            left = XpositionBall - radiusBall;
+
+            if((top >= YPositionBlock - size) && (top <= YPositionBlock + size) && (left <= XPositionBlock + size) && (left >= XPositionBlock - size))
+        }
+    }
+  */  
 }
Index: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	(revision 12367)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.cc	(revision 12368)
@@ -68,5 +68,5 @@
         this->relMercyOffset_ = 0.05f;
         this->orxoblox_ = this->getOrxoBlox();
-        this->radius_ = 1.5;
+        this->radius_ = 3;
 
         this->registerVariables();
@@ -137,13 +137,13 @@
 
         // 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_ / 2 || position.z - radius_ < -this->fieldHeight_ / 2)
         {
             defBoundarySound_->play(); //play boundary sound
             // Its velocity in z-direction is inverted (i.e. it bounces off).
             velocity.z = -velocity.z;
-            // And its position is set as to not overstep the boundary it has just crossed.
+            // 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){
                 // Set the ball to be exactly at the boundary.
-                position.z = this-> fieldHeight_ / 2;
+                position.z = this-> fieldHeight_ / 2 - radius_;
                 
                 orxoblox_->LevelUp();
@@ -180,6 +180,6 @@
 
             }
-            if (position.z < -this->fieldHeight_ / 2){
-                position.z = -this->fieldHeight_ / 2;
+            if (position.z - radius_ < -this->fieldHeight_ / 2){
+                position.z = -this->fieldHeight_ / 2 + radius_;
                 
             }
@@ -190,11 +190,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 + radius_ > this->fieldWidth_ / 2 || position.x - radius_ < -this->fieldWidth_ / 2)
         {
             //Ball hits the right Wall
-            if (position.x > this->fieldWidth_ / 2)
+            if (position.x + radius_ > this->fieldWidth_ / 2)
                 {
                     // Set the ball to be exactly at the boundary.
-                    position.x = this->fieldWidth_ / 2;
+                    position.x = this->fieldWidth_ / 2 - radius_;
                     // Invert its velocity in x-direction (i.e. it bounces off).
                     velocity.x = -velocity.x;
@@ -203,8 +203,8 @@
 
             //Ball hits the left wall
-            else if (position.x < -this->fieldWidth_ / 2)
+            else if (position.x - radius_ < -this->fieldWidth_ / 2)
                 {
                         // Set the ball to be exactly at the boundary.
-                        position.x = -this->fieldWidth_ / 2;
+                        position.x = -this->fieldWidth_ / 2 + radius_;
                         // Invert its velocity in x-direction (i.e. it bounces off).
                         velocity.x = -velocity.x;
@@ -220,5 +220,5 @@
         if (position != this->getPosition())
             this->setPosition(position);
-        this->Collides((this->orxoblox_->CheckForCollision(this)));
+        //this->Collides((this->orxoblox_->CheckForCollision(this)));
 
  
@@ -289,5 +289,5 @@
 
 
-    void OrxoBloxBall::Bounce(OrxoBloxStones* Stone) {
+    void OrxoBloxBall::Bounce(WorldEntity* Stone) {
 
         Vector3 velocity = this->getVelocity();
@@ -337,8 +337,16 @@
         Bounce(Stone);
         //if(otherObject->getHealth() <= 0) {
-        Stone->destroy();
+        //Stone->destroy();
 
         //}
         //otherObject->reduceHealth();
+    }
+
+    bool OrxoBloxBall::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint)
+    {
+        orxout() << "detected collision" << endl;
+        Bounce(otherObject);
+
+        return true;
     }
 
Index: code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	(revision 12367)
+++ code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h	(revision 12368)
@@ -111,6 +111,7 @@
         
 
-            void Bounce(OrxoBloxStones* otherObject);
+            void Bounce(WorldEntity* Stone);
             void Collides(OrxoBloxStones* otherObject);
+            bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
 
             static const float MAX_REL_Z_VELOCITY;
