Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11769


Ignore:
Timestamp:
Feb 18, 2018, 5:23:29 PM (6 years ago)
Author:
landauf
Message:

[SOBv2_HS17] removed unused variables, added some initializations

Location:
code/branches/Presentation_HS17_merge/src/modules/superorxobros
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.cc

    r11766 r11769  
    6060    {
    6161        RegisterObject(SOB);
    62         camera = nullptr;
    6362
    6463        this->center_ = nullptr;
     
    6968        timeLeft_=400.0;
    7069        done_ = true;
     70        newHighscore = false;
    7171        lvl_ = 1;
    7272
     
    7979    SOB::~SOB()
    8080    {
    81         if (this->isInitialized())
    82             this->cleanup();
    8381    }
    84 
    85     void SOB::cleanup()
    86     {
    87         camera = nullptr;
    88     }
    89 
    90 
    9182
    9283    void SOB::start()
     
    113104        Gametype::start();
    114105
    115         if (figure_ != nullptr)
    116         {
    117             camera = figure_->getCamera();
    118         }
    119 
    120106    }
    121107
    122108    void SOB::end()
    123109    {
    124         cleanup();
    125110        GSLevel::startMainMenu();
    126111        Deathmatch::end();
     
    128113
    129114    void SOB::restart() {
    130         cleanup();
    131 
    132115        // HACK - only method I found to simply reload the level
    133116        Game::getInstance().popState();
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOB.h

    r11766 r11769  
    111111
    112112
    113             void cleanup(); //!< Cleans up the Gametype
    114113            WeakPtr<SOBFigure> figure_;
    115             WeakPtr<Camera> camera;
    116114            int points_;
    117115            int coins_;
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBCoin.cc

    r11420 r11769  
    4949        setAngularFactor(0.0);
    5050
     51        speed_ = 0;
     52        lifetime_ = 0;
    5153    }
    5254
     
    6769        lifetime_-=dt;
    6870
    69         if (lifetime_ <+ 0) {
     71        if (lifetime_ < 0) {
    7072            destroyLater();
    7173        }
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBCoin.h

    r11416 r11769  
    5050
    5151
    52         bool attachedToFigure_;
    53 
    5452        void setLifetime(const float lt)
    5553        { this->lifetime_ = lt; }
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.cc

    r11768 r11769  
    6969        moveDownPressed_    = false;
    7070        moveLeftPressed_    = false;
    71         moveDownPressed_    = false;
     71        moveRightPressed_    = false;
    7272        firePressed_        = false;
    7373        collDisZ_           = 0;
     
    7676        timeSinceLastFire_  = 0.0;
    7777        lastSpeed_z         = 0.0;
    78         pitch_              = 0.0;
    7978        timeCounter_        = 0;
    8079
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFigure.h

    r11766 r11769  
    6868            float lastSpeed_z;
    6969            float firecooldown_;
    70             SOBCenterpoint* sobcenterpoint;
    71             float pitch_;
    7270            bool isColliding_;
    7371            WorldEntity* particlespawner_;
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.cc

    r11766 r11769  
    5656        RegisterObject(SOBFireball);
    5757
    58         attachedToFigure_ = false;
    5958        setAngularFactor(0.0);
    60         figure_ = nullptr;
    6159        this->enableCollisionCallback();
    6260        gravityAcceleration_ = 350.0;
     
    6462        speed_ = 0;
    6563        hasCollided_=false;
    66         lastPos_ = getPosition();
    67         lastPos_.x -= 20;
    6864        changeAllowed_ = true;
    6965        changedOn_ = 0.0;
    7066        goesRight_ = true;
    71         collDisX_ = 0;
    72         collDisZ_ = 0;
    7367        hitCounter_ = 0;
    7468        particlespawner_ = NULL ;
     
    10498   
    10599    bool SOBFireball::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
    106         collDisX_ = getPosition().x - contactPoint.getPositionWorldOnB().getX();
    107         collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ();
     100        float collDisX_ = getPosition().x - contactPoint.getPositionWorldOnB().getX();
     101        float collDisZ_ = getPosition().z - contactPoint.getPositionWorldOnB().getZ();
    108102
    109103        SOBGumba*       gumba       = orxonox_cast<SOBGumba*>       (otherObject);
     
    148142        hitCounter_++;
    149143       
    150         collDisZ_=0;
    151         collDisX_=0;
    152 
    153144        return true;
    154145    }
    155 
    156 
    157     void SOBFireball::setFigure(SOBFigure* newFigure)
    158     {
    159         figure_ = newFigure;
    160     }
    161 
    162146
    163147
     
    199183            setVelocity(velocity);
    200184
    201             lastPos_ = getPosition();
    202 
    203185            if(abs(this->getPosition().z) > 1000) delete this;
    204186       
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFireball.h

    r11766 r11769  
    5050
    5151            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    52             virtual void setFigure(SOBFigure* newFigure);
    5352            virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5453            virtual void tick(float dt) override;
    5554            void setDirection(const bool direction);
    5655         
    57             bool attachedToFigure_;
    58 
    5956            void setSpeed(const float speed)
    6057                { this->speed_ = speed; }
     
    6663            float gravityAcceleration_;
    6764            float speed_;
    68             WeakPtr<SOBFigure> figure_;
    69             Vector3 lastPos_;
    7065            bool goesRight_;
    7166            bool changeAllowed_;
     
    7368            int hitCounter_;
    7469            WorldEntity* particlespawner_;
    75 
    76  
    77 
    78 
    79             float collDisX_;   
    80             float collDisZ_;
    8170           
    8271    };
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBFlagstone.cc

    r11416 r11769  
    5252       
    5353        hasCollided_=false;
    54        
     54        points_=0;
    5555       
    5656    }
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.cc

    r11766 r11769  
    4848        RegisterObject(SOBGumba);
    4949
    50         attachedToFigure_ = false;
    5150        setAngularFactor(0.0);
    52         figure_ = nullptr;
    5351        this->enableCollisionCallback();
    5452        gravityAcceleration_ = 350.0;
     
    5654        hasCollided_=false;
    5755        goesRight_ = true;
    58         lastPos_ = getPosition();
    59         lastPos_.x -= 20;
    6056        changeAllowed_ = true;
    6157        changedOn_ = 0.0;
     
    8884    }
    8985
    90 
    91     void SOBGumba::setFigure(SOBFigure* newFigure)
    92     {
    93         figure_ = newFigure;
    94     }
    9586
    9687    void SOBGumba::setDirection(const bool direction)
     
    140131        setVelocity(velocity);
    141132
    142         lastPos_ = getPosition();
    143 
    144133        if (creator_ != nullptr)
    145134        {
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumba.h

    r11766 r11769  
    4747            SOBGumba(Context* context);
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    49             virtual void setFigure(SOBFigure* newFigure);
    5049            virtual  bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5150            virtual void tick(float dt) override;
     
    5453            void die();
    5554         
    56             bool attachedToFigure_;
    57 
    5855            void setSpeed(const float speed)
    5956                { this->speed_ = speed; }
     
    6663            float gravityAcceleration_;
    6764            float speed_;
    68             WeakPtr<SOBFigure> figure_;
    6965            bool goesRight_;
    70             Vector3 lastPos_;
    7166            bool changeAllowed_;
    7267            float changedOn_;
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBGumbaBoss.cc

    r11766 r11769  
    152152        setVelocity(velocity);
    153153
    154         lastPos_ = getPosition();
    155 
    156154    }
    157155
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBMushroom.cc

    r11416 r11769  
    4848        RegisterObject(SOBMushroom);
    4949
    50         attachedToFigure_ = false;
    5150        setAngularFactor(0.0);
    52         figure_ = nullptr;
    5351        this->enableCollisionCallback();
    5452        gravityAcceleration_ = 350.0;
     
    5654        hasCollided_=false;
    5755        goesRight_ = true;
    58         lastPos_ = getPosition();
    59         lastPos_.x -= 20;
    6056        changeAllowed_ = true;
    6157        changedOn_ = 0.0;
     
    8682
    8783
    88     void SOBMushroom::setFigure(SOBFigure* newFigure)
    89     {
    90         figure_ = newFigure;
    91     }
    92 
    93 
    94 
    9584    void SOBMushroom::tick(float dt)
    9685    {
     
    10493                changedOn_ = 0.0;
    10594
     95            }
    10696        }
    107     }
    10897       
    10998
     
    116105        velocity.x = dir*speed_;
    117106        setVelocity(velocity);
    118 
    119 
    120    
    121         lastPos_ = getPosition();
    122             }
     107    }
    123108
    124109
  • code/branches/Presentation_HS17_merge/src/modules/superorxobros/SOBMushroom.h

    r11416 r11769  
    4747            SOBMushroom(Context* context);
    4848            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    49             virtual void setFigure(SOBFigure* newFigure);
    5049            virtual  bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    5150            virtual void tick(float dt) override;
    5251
    5352         
    54             bool attachedToFigure_;
    55 
    5653            void setSpeed(const float speed)
    5754                { this->speed_ = speed; }
     
    6360            float gravityAcceleration_;
    6461            float speed_;
    65             WeakPtr<SOBFigure> figure_;
    6662            bool goesRight_;
    67             Vector3 lastPos_;
    6863            bool changeAllowed_;
    6964            float changedOn_;
Note: See TracChangeset for help on using the changeset viewer.