Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 30, 2017, 2:33:33 PM (7 years ago)
Author:
merholzl
Message:

final XMLPort things. Changes in spaceshipFlappyOrx

Location:
code/branches/FlappyOrx_HS17/src/modules/flappyorx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc

    r11505 r11514  
    101101        if (player == nullptr)
    102102        {
    103             for (FlappyOrxShip* ship : ObjectList<FlappyOrxShip>())
     103            for (FlappyOrxShip* ship : ObjectList<FlappyOrxShip>()) {
    104104                player = ship;
     105            }
    105106        }
    106107        return player;
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc

    r11509 r11514  
    4949        RegisterObject(FlappyOrxShip);
    5050
    51         UpwardThrust = 250;
    52         speed = 50;
    53         gravity = 20;
    54          void AutonomousDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
     51        this->UpwardThrust = 1;
     52        this->speed = 1;orxout() << "constr speed set: " << 1 << endl;
     53        this->gravity = 1;
     54       
     55    }
     56    void FlappyOrxShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5557        {   
    56             SUPER(AutonomousDrone, XMLPort, xmlelement, mode);
     58            SUPER(FlappyOrxShip, XMLPort, xmlelement, mode);
    5759            XMLPortParam(FlappyOrxShip, "speed", setSpeed, getSpeed, xmlelement, mode);
    5860            XMLPortParam(FlappyOrxShip, "UpwardThrust", setUpwardThrust, getUpwardThrust, xmlelement, mode);
    5961            XMLPortParam(FlappyOrxShip, "gravity", setGravity, getGravity, xmlelement, mode);
    60         }
    6162    }
     63
    6264    void FlappyOrxShip::tick(float dt)
    63     {  //Execute movement
     65    {
     66        SUPER(FlappyOrxShip, tick, dt);
     67        //Execute movement
    6468        if (this->hasLocalController())
    6569        {
     
    7276            }
    7377
    74            
    7578            pos += Vector3(speed + velocity.x, 0, velocity.y) * dt;
    7679           
     
    100103           
    101104        }
    102 
    103 
    104         SUPER(FlappyOrxShip, tick, dt);
    105105    }
    106106
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.h

    r11511 r11514  
    6262            virtual void rotateRoll(const Vector2& value) override;
    6363            inline void setSpeed( float speed )
    64                 { this->speed = speed; }
    65             inline void getSpeed( )
     64                { orxout() << "speed set: " << speed << endl; this->speed = speed; }
     65            inline float getSpeed( )
    6666                { return this->speed; }
    6767            inline void setGravity( float gravity )
    6868                { this->gravity = gravity; }
    69             inline void getGravity()
     69            inline float getGravity()
    7070                { return this->gravity; }
    71             inline void setSpeed( float UpwardThrust )
     71            inline void setUpwardThrust( float UpwardThrust )
    7272                { this->UpwardThrust = UpwardThrust; }
    73             inline void getSpeed()
     73            inline float getUpwardThrust()
    7474                { return this->UpwardThrust; }
    7575            virtual void updateLevel();
     76            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    7677
    7778        protected:
Note: See TracChangeset for help on using the changeset viewer.