Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2017, 3:18:27 PM (7 years ago)
Author:
jkindle
Message:

Added the animation for the level end (walk into castle), Coins for the blocks, Castleblocks and Flagblocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SuperOrxoBros_FS17/src/modules/superorxobros/SOBGumba.cc

    r11412 r11416  
    2121 *
    2222 *   Author:
    23  *      Fabien Vultier
     23 *      Julien Kindle
    2424 *   Co-authors:
    25  *      ...
     25 *     
    2626 *
    2727 */
     
    7676    bool SOBGumba::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) {
    7777
    78 
     78        //Every object with mass -1 does not change the direction of the Gumba. For example the ground floor! The other objects switch the direction of the gumba.
    7979        if (changeAllowed_ && otherObject->getMass() != -1) {
    8080            goesRight_ = !goesRight_;
     
    9191    }
    9292
    93     void SOBGumba::touchFigure()
    94     {
    9593
    96     }
    9794
    9895    void SOBGumba::tick(float dt)
     
    10299        if (!changeAllowed_) {
    103100            changedOn_+= dt;
    104             if (changedOn_> 200) {
     101            // After a collision, we don't listen for collisions for 200ms - that's because one wall can cause several collisions!
     102            if (changedOn_> 0.200) {
    105103                changeAllowed_ = true;
    106104                changedOn_ = 0.0;
     
    119117        setVelocity(velocity);
    120118
    121 
    122        
    123119        lastPos_ = getPosition();
    124120    }
     
    126122
    127123}
    128 /*
    129  *   ORXONOX - the hottest 3D action shooter ever to exist
    130  *                    > www.orxonox.net <
    131  *
    132  *
    133  *   License notice:
    134  *
    135  *   This program is free software; you can redistribute it and/or
    136  *   modify it under the terms of the GNU General Public License
    137  *   as published by the Free Software Foundation; either version 2
    138  *   of the License, or (at your option) any later version.
    139  *
    140  *   This program is distributed in the hope that it will be useful,
    141  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    142  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    143  *   GNU General Public License for more details.
    144  *
    145  *   You should have received a copy of the GNU General Public License
    146  *   along with this program; if not, write to the Free Software
    147  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    148  *
    149  *   Author:
    150  *      Fabien Vultier
    151  *   Co-authors:
    152  *      ...
    153  *
    154  */
    155 
    156 /**
    157     @file SOBGumba.h
    158     @brief Declaration of the SOBGumba class.
    159     @ingroup SOB
    160 */
    161 
    162 #ifndef _SOBGumba_H__
    163 #define _SOBGumba_H__
    164 
    165 #include "superorxobros/SOBPrereqs.h"
    166 #include "worldentities/MovableEntity.h"
    167 
    168 
    169 namespace orxonox
    170 {
    171     class _SOBExport SOBGumba : public MovableEntity
    172     {
    173     public:
    174         SOBGumba(Context* context);
    175         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    176         virtual void setFigure(SOBFigure* newFigure);
    177         virtual void touchFigure();
    178         virtual  bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    179         virtual void tick(float dt) override;
    180 
    181        
    182         bool attachedToFigure_;
    183 
    184         void setSpeed(const float speed)
    185         { this->speed_ = speed; }
    186         float getSpeed() const
    187         { return speed_; }
    188 
    189         bool hasCollided_;
    190     protected:
    191         float gravityAcceleration_;
    192         float speed_;
    193         WeakPtr<SOBFigure> figure_;
    194         bool goesRight_;
    195         Vector3 lastPos_;
    196         bool changeAllowed_;
    197         float changedOn_;
    198        
    199     };
    200 }
    201 
    202 #endif /* _SOBGumba_H__ */
Note: See TracChangeset for help on using the changeset viewer.