Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2019, 11:00:57 AM (6 years ago)
Author:
ahuwyler
Message:

We have a spaceship!

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

Legend:

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

    r12366 r12367  
    77  OrxoBloxStones.cc
    88  OrxoBloxScore.cc
    9 
     9  OrxoBloxShip.cc
    1010
    1111)
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12366 r12367  
    129129    */
    130130    void OrxoBlox::start()
     131
    131132    {
    132133        if (this->center_ != nullptr) // There needs to be a OrxoBloxCenterpoint, i.e. the area the game takes place.
     
    169170        // Set variable to temporarily force the player to spawn.
    170171        // Set variable to temporarily force the player to spawn.
    171         bool temp = this->bForceSpawn_;
     172        //bool temp = this->bForceSpawn_;
    172173        this->bForceSpawn_ = true;
    173174
     
    176177
    177178        // Reset the variable.
    178         this->bForceSpawn_ = temp;
     179        //this->bForceSpawn_ = temp;
    179180
    180181    }
     
    206207    }
    207208   
    208     void OrxoBlox::spawnPlayer(PlayerInfo* player)
    209     {
    210         assert(player);
    211 
    212         if(this->player_ == nullptr)
    213         {
    214             this->player_ = player;
    215             this->players_[player].state_ = PlayerState::Alive;
    216         }
    217 
    218     }
     209    // void OrxoBlox::spawnPlayer(PlayerInfo* player)
     210    // {
     211    //     assert(player);
     212
     213    //     if(this->player_ == nullptr)
     214    //     {
     215    //         this->player_ = player;
     216    //         this->players_[player].state_ = PlayerState::Alive;
     217    //     }
     218
     219    // }
    219220
    220221    void OrxoBlox::LevelUp(){
     
    287288    OrxoBloxStones* OrxoBlox::CheckForCollision(OrxoBloxBall* Ball) {
    288289
    289         orxout() << "Checking for Collision" << endl;
     290        //orxout() << "Checking for Collision" << endl;
    290291        Vector3 BallPosition = Ball->getPosition();
    291292        for(OrxoBloxStones* someStone : this->stones_)
     
    295296                continue;
    296297            }
    297             orxout() << "Checking a stone" << endl;
     298            //orxout() << "Checking a stone" << endl;
    298299            const Vector3& StonePosition = someStone->getPosition(); //!< Saves the position of the currentStone
    299300            int size = someStone->getSize()/2;
     
    307308        return nullptr;
    308309    }
     310
     311    void OrxoBlox::playerPreSpawn(PlayerInfo* player)
     312    {
     313        this->player_ = player;
     314    }
    309315   
    310316}
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12359 r12367  
    7474
    7575            PlayerInfo* getPlayer();
    76             void spawnPlayer(PlayerInfo* Player) override;
     76            // void spawnPlayer(PlayerInfo* Player) override;
     77            virtual void playerPreSpawn(PlayerInfo* player) override;
     78
    7779
    7880            void LevelUp();
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc

    r12337 r12367  
    3434
    3535#include "OrxoBloxShip.h"
     36#include "OrxoBlox.h"
    3637#include "core/CoreIncludes.h"
    3738
     
    4748        this->width = 120;
    4849        this->height = 100;
    49         orxout() << "Spawned" << std::endl;
     50        orxout() << "SPACESHIP Spawned" << std::endl;
    5051
    5152        //timer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxoBloxShip::showorientation, this)));
     
    7172        Vector3 pos = this->getPosition();
    7273
    73         //ensure that the ship stays in playing field
    74         if(pos.x > width/2)   pos.x = -width/2;
    75         if(pos.x < -width/2)  pos.x = width/2;
    76 
    77         //2D movement, position should always = 0 on y-axis
    78         if(pos.y!=0) pos.y = 0;
    79         this->setPosition(pos);
    80         if(pos.z!=50) pos.z = 50;
    8174    }
    8275
     
    9790    }
    9891}
     92
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h

    r12298 r12367  
    3636
    3737
    38 #include "asteroids2D/Asteroids2DPrereqs.h"
     38#include "OrxoBloxPrereqs.h"
    3939
    4040#include "worldentities/pawns/SpaceShip.h"
Note: See TracChangeset for help on using the changeset viewer.