Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2019, 4:57:28 PM (6 years ago)
Author:
jeromela
Message:

Zielvisier eingefuegt

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

Legend:

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

    r12384 r12391  
    332332    }
    333333   
     334    void OrxoBlox::tick(float dt)
     335    {       
     336        SUPER(OrxoBlox, tick, dt);
     337    }
    334338/*
    335339    bool OrxoBlox::Intersect(int XpositionBall, int XPositionBlock, int YPositionBall, int YPositionBlock, int radiusBall, int sizeBlock) {
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12371 r12391  
    7676            // void spawnPlayer(PlayerInfo* Player) override;
    7777            virtual void playerPreSpawn(PlayerInfo* player) override;
    78 
     78            virtual void tick(float dt) override;
    7979
    8080            void LevelUp();
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.cc

    r12370 r12391  
    6969    void OrxoBloxShip::tick(float dt)
    7070    {
    71         SUPER(OrxoBloxShip, tick, dt);
    7271        Vector3 pos = this->getPosition();
     72
     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        if(pos.z > height/2)  pos.z = -height/2;
     77        if(pos.z < -height/2) pos.z = height/2;
     78
     79        //2D movement, position should always = 0 on y-axis
     80        if(pos.y!=0) pos.y = 0;
    7381        this->setPosition(pos);
     82
     83
     84        //if you hit an asteroid, the ship will turn -> you need to reorientate the ship
     85        Quaternion ort = this->getOrientation();
     86        ort.x = 0;
     87        ort.z = 0;
     88        this->setOrientation(ort);
    7489    }   
    7590
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxShip.h

    r12370 r12391  
    5353            //virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction.
    5454            //Yaw
     55            virtual void rotatePitch(const Vector2& value) override{}; // Rotate in pitch direction.
    5556            virtual void rotateRoll(const Vector2& value) override{}; // Rotate in roll direction.
    5657            virtual void boost(bool boost) override; //Override, so that the ship does not shake
     58           
    5759           
    5860            /*Functions that can be helpful while debugging.
     
    6971            }
    7072
    71         protected:
     73        //protected:
    7274        private:
    7375            OrxoBlox* getGame();
  • code/branches/OrxoBlox_FS19/src/modules/asteroids2D/Asteroids2DShip.cc

    r11781 r12391  
    6969    void Asteroids2DShip::tick(float dt)
    7070    {
    71         SUPER(Asteroids2DShip, tick, dt);
     71        //SUPER(Asteroids2DShip, tick, dt);
    7272        Vector3 pos = this->getPosition();
    7373
Note: See TracChangeset for help on using the changeset viewer.