Index: code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	(revision 12367)
+++ code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	(revision 12368)
@@ -14,8 +14,8 @@
         </links>
         <Weapon>
-          <Asteroids2DWeapon mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
+          <BallGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
         </Weapon>
         <Weapon>
-          <Asteroids2DWeapon mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
+          <BallGun mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
         </Weapon>
       </WeaponPack>
@@ -27,4 +27,4 @@
     </weaponpacks>
     <munition>
-      <LaserMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
+      <BallMunition initialmagazines=8 maxmagazines=8 munitionpermagazine=10 replenishamount=1 replenishinterval=0.5/>
     </munition>
Index: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	(revision 12367)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	(revision 12368)
@@ -42,4 +42,7 @@
       <ParticleSpawner name=hiteffect position="0,0,0" source="Orxonox/sparks2" lifetime=0.01 autostart=0 mainstate=spawn />
     </attached>
+      <collisionShapes>
+          <SphereCollisionShape radius="2" />
+      </collisionShapes>
     <eventlisteners>
       <EventTarget target=hiteffect />
@@ -56,4 +59,7 @@
         <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
       </attached>
+      <collisionShapes>
+                <BoxCollisionShape halfExtents="4.5, 4.5, 4.5" />
+      </collisionShapes>
     </OrxoBloxStones>
   </Template>
@@ -63,4 +69,7 @@
   <Template name=OrxoBloxwall>
     <OrxoBloxWall>
+            <collisionShapes>
+                <BoxCollisionShape halfExtents="4.5, 4.5, 4.5" />
+      </collisionShapes>
     </OrxoBloxWall>
   </Template>
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;
Index: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	(revision 12367)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	(revision 12368)
@@ -33,4 +33,7 @@
 
 #include "BallProjectile.h"
+#include "../OrxoBlox/OrxoBlox.h"
+#include "gametypes/Gametype.h"
+
 
 #include <OgreParticleEmitter.h>
@@ -54,4 +57,5 @@
         this->maxTextureIndex_ = 8;
         this->setDestroyAfterCollision(false); //I want the ball to bounce, not to be destroyed
+        //this->orxoblox_ = this->getOrxoBlox();
 
         //setEffect("Orxonox/sparks2");
@@ -135,7 +139,4 @@
     }
 
-
-
-
     
     bool BallProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
@@ -151,6 +152,16 @@
 
 
-
-
+    /*
+    OrxoBlox* BallProjectile::getOrxoBlox()
+    {
+        if (this->getGametype() != nullptr && this->getGametype()->isA(Class(OrxoBlox)))
+        {
+            OrxoBlox* orxobloxGametype = orxonox_cast<OrxoBlox*>(this->getGametype());
+            return orxobloxGametype;
+        }
+        else orxout()<<"There is no Gametype for OrxoBlox! ask Anna"<< endl;
+        return nullptr;
+    }
+    */
 
 
@@ -159,5 +170,5 @@
         SUPER(BallProjectile, tick, dt);
 
-        // Get the current position, velocity and acceleration of the ball.
+               // Get the current position, velocity and acceleration of the ball.
         Vector3 position = this->getPosition();
         Vector3 velocity = this->getVelocity();
@@ -167,11 +178,48 @@
         if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
         {
-            // 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.
-            if (position.z > this->fieldHeight_ / 2)
-                position.z = this->fieldHeight_ / 2;
-            if (position.z < -this->fieldHeight_ / 2)
-                position.z = -this->fieldHeight_ / 2;
+            // 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;
+                
+                //orxoblox_->LevelUp();
+
+
+                //this->setSpeed(0); // doesn't work here, why??;
+                //Stopping ball
+                orxout() << "Ball stopped" << endl;
+                velocity.x = 0;
+                velocity.y = 0;
+                velocity.z = 0; 
+
+                //ChatManager::message("Waiting for your input");
+                //Input new speed here:
+                //ChatManager::message("Setting new speed");
+                
+                //%%%%%%%%%%%%
+                //MAUSPOSITION
+                //%%%%%%%%%%%%
+                //Reads current mouse position
+                //TODO: read Mouse position on click!
+                //int mousex = InputManager::getInstance().getMousePosition().first;
+                //int mousey = InputManager::getInstance().getMousePosition().second;
+                //ChatManager::message("Read mouse position");
+                //orxout() << "Mouseposition" << endl;
+                //orxout() << mousex << endl;
+                //ChatManager::message(mousex);
+                //ChatManager::message("mousey");
+                //ChatManager::message(mousey);
+                //Set new speed here!!
+                velocity.x = rnd(-100,100);
+                velocity.z = rnd(-50,-100);
+                
+
+            }
+            if (position.z < -this->fieldHeight_ / 2){
+                position.z = -this->fieldHeight_ / 2 ;
+                
+            }
 
             this->fireEvent();
@@ -210,6 +258,7 @@
         if (position != this->getPosition())
             this->setPosition(position);
-    }
-
+        //this->Collides((this->orxoblox_->CheckForCollision(this)));
+
+    }
 
 
Index: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	(revision 12367)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	(revision 12368)
@@ -37,4 +37,7 @@
 #include "weapons/WeaponsPrereqs.h"
 #include "weapons/projectiles/BillboardProjectile.h"
+#include "../OrxoBlox/OrxoBlox.h"
+
+#include "OrxoBlox/OrxoBloxPrereqs.h"
 
 namespace orxonox
@@ -65,4 +68,5 @@
             void registerVariables();
             void changeTexture();
+            //OrxoBlox* getOrxoBlox();
             
             float speed_; //!< The speed (in x-direction) of the ball.
@@ -72,4 +76,5 @@
             unsigned int maxTextureIndex_; //!< The maximal index.
             std::string materialBase_; //!< The base name of the material.
+            //OrxoBlox* orxoblox_;
     };
 }
