Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2019, 4:40:50 PM (6 years ago)
Author:
pomselj
Message:

Ball can do bouncy stuff

Location:
code/branches/OrxoBlox_FS19/src/modules/OrxoBlox
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12336 r12337  
    6464        Constructor. Registers and initializes the object.
    6565    */
    66     OrxoBlox::OrxoBlox(Context* context) : Deathmatch(context)
     66    OrxoBlox::OrxoBlox(Context* context) : ::orxonox::Deathmatch::Deathmatch(context)
    6767    {
    6868        RegisterObject(OrxoBlox);
     
    154154            this->createWall();
    155155
     156            //Create Ship
     157            //this->ship_ = new OrxoBloxShip(this->center_->getContext());
     158            //this->ship_->setPosition(0, 0, 0);
     159
    156160        }
    157161        else // If no centerpoint was specified, an error is thrown and the level is exited.
     
    166170
    167171        // Set variable to temporarily force the player to spawn.
    168         this->bForceSpawn_ = false;
     172        this->bForceSpawn_ = true;
    169173
    170174        // Call start for the parent class.
     
    186190    }
    187191
    188     /**
    189     @brief
    190         Spawns the input player.
    191     @param player
    192         The player to be spawned.
    193     */
     192    OrxoBloxShip* OrxoBlox::getPlayer()
     193    {
     194        if (playership == nullptr)
     195        {
     196            for (OrxoBloxShip* ship_ : ObjectList<OrxoBloxShip>())
     197            {
     198                playership = ship_;
     199            }
     200        }
     201        return playership;
     202    }
     203   
    194204    void OrxoBlox::spawnPlayer(PlayerInfo* player)
    195205    {
    196          assert(player);
     206        assert(player);
    197207
    198208        if(this->player_ == nullptr)
     
    201211            this->players_[player].state_ = PlayerState::Alive;
    202212        }
    203     }
    204 
    205 
    206     OrxoBloxShip* OrxoBlox::getPlayer()
    207     {
    208         for (OrxoBloxShip* ship : ObjectList<OrxoBloxShip>())
    209         {
    210             return ship;
    211         }
    212         return nullptr;
     213
    213214    }
    214215
    215216    //void startWall(void);
    216    
    217217    void OrxoBlox::LevelUp(){
    218218        level_++;
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12331 r12337  
    4343#include "OrxoBloxCenterpoint.h"
    4444#include "OrxoBloxWall.h"
     45#include "OrxoBloxShip.h"
    4546
    4647namespace orxonox
     
    7273            virtual void end() override; ///!< Ends the OrxoBlox minigame.
    7374
    74             virtual void spawnPlayer(PlayerInfo* player) override; //!< Spawns the input player.
    75 
    7675            OrxoBloxShip* getPlayer();
     76            void spawnPlayer(PlayerInfo* Player) override;
    7777
    7878            void LevelUp();
     
    9797            WeakPtr<OrxoBloxCenterpoint> center_; //!< The playing field.
    9898            WeakPtr<OrxoBloxBall> ball_; //!< The OrxoBlox ball.
     99            unsigned int level_;
    99100           
     101            WeakPtr<OrxoBloxShip> playership;
    100102            PlayerInfo* player_;
    101             unsigned int level_;
    102 
    103103            Timer starttimer_; //!< A timer to delay the start of the game.
    104104           
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h

    r12331 r12337  
    122122                { return this->batlength_; }
    123123
     124
     125            void Bounce(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint);
    124126           
    125 
     127            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    126128
    127129            static const float MAX_REL_Z_VELOCITY;
     
    133135            void setDefBoundarySound(const std::string& engineSound);
    134136            const std::string& getDefBoundarySound();
    135             void Bounce(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint);
    136             virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    137137
    138138        private:
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc

    r12298 r12337  
    3434
    3535#include "OrxoBloxShip.h"
    36 #include "OrxoBloxShip.h"
    3736#include "core/CoreIncludes.h"
    3837
     
    4847        this->width = 120;
    4948        this->height = 100;
     49        orxout() << "Spawned" << std::endl;
    5050
    5151        //timer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxoBloxShip::showorientation, this)));
Note: See TracChangeset for help on using the changeset viewer.