Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11987


Ignore:
Timestamp:
May 24, 2018, 3:03:43 PM (6 years ago)
Author:
micwagne
Message:

added Tube Function in Game

Location:
code/branches/SuperOrxoBros_FS18
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SuperOrxoBros_FS18/data/levels/SOB.oxw

    r11783 r11987  
    3939                <SOBFigure>
    4040                        <camerapositions>
    41                                 <CameraPosition position="0,-150,30" absolute=true mouselook=false drag=false direction="0,1,0"/>
     41                                <CameraPosition position="0,-250,30" absolute=true mouselook=false drag=false direction="0,1,0"/>
    4242                        </camerapositions>
    4343                </SOBFigure>
     
    122122
    123123
    124 
    125 
    126 
     124                                        <!-- SOBGumbas undergroundlevel-->
     125                                        <SOBGumba collisionType="dynamic" speed=20 position = "350,0,-70">
     126                                                <attached>
     127                                                        <Model mesh="Goomba.mesh" position="0,0,1" scale=3 pitch=90/>
     128                                                       
     129                                                </attached>
     130                                                <collisionShapes>
     131                                                        <BoxCollisionShape position="0,0,0" halfExtents="5,5,3" />                     
     132                                                </collisionShapes>
     133                                        </SOBGumba>
     134
     135
     136
     137                                                <!-- SOBGumbas groundlevel-->
    127138                                        <SOBGumba collisionType="dynamic" speed=40 position = "240,0,0">
    128139                                                <attached>
     
    259270                                        <StaticEntity collisionType="static" mass='-1'>
    260271                                                <collisionShapes>
    261                                                         <BoxCollisionShape position="340,0,-20" halfExtents="345,5,5" />
    262                                                 </collisionShapes>
    263                                         </StaticEntity>
    264 
    265 
     272                                                        <BoxCollisionShape position="140,0,-20" halfExtents="135,5,5" />
     273                                                        <BoxCollisionShape position="330,0,-20" halfExtents="30,5,5" />
     274                                                        <BoxCollisionShape position="400,0,-20" halfExtents="60,5,5" />
     275                                                        <BoxCollisionShape position="530,0,-20" halfExtents="50,5,5" />
     276                                                        <BoxCollisionShape position="640,0,-20" halfExtents="40,5,5" />
     277                                                </collisionShapes>
     278                                        </StaticEntity>
     279                                        <!-- Boden 1 Unterirdisch-->
     280                                        <Model mesh="Cube2.12.mesh" position="270,0,-90" scale=10 Pitch=90/>                                    <!-- B1.1 -->
     281                                        <Model mesh="Cube2.12.mesh" position="390,0,-90" scale=10 Pitch=90/>                            <!-- B1.2-->
     282                                       
     283                                        <!-- CollisionShape fuer Unterirdisch-->
     284                                        <StaticEntity collisionType="static" mass='-1'>
     285                                                <collisionShapes>
     286                                                        <BoxCollisionShape position="390,0,-80" halfExtents="125,5,5" />
     287                                                 
     288                                                </collisionShapes>
     289                                        </StaticEntity>
     290                                        <StaticEntity collisionType="static" mass='1000000000'>
     291                                                <collisionShapes>
     292                                                         
     293                                                        <BoxCollisionShape position="265,0,-80" halfExtents="5,5,5" />
     294                                                        <BoxCollisionShape position="510,0,-80" halfExtents="5,5,5" />
     295                                                </collisionShapes>
     296                                        </StaticEntity>
    266297
    267298
     
    316347                                        </SOBQBlock>
    317348                                       
    318                                         <Model mesh="Cube1.1.mesh" position="250,0,20" scale=10/>                                                                                               <!-- L1.7 -->
     349                                       
     350                                        <SOBTube collisionType="dynamic" cool=1 position="295,5,-23" mass='10000'>
     351                                                <attached>
     352                                                                                                       
     353                                                        <Model mesh="Rohr.mesh" position="0,0,-12" scale=10 roll=90 yaw=90 pitch=-90/> 
     354                                                </attached>
     355                                        </SOBTube>
     356                                       
     357                                        <SOBTube collisionType="dynamic" cool=1 position="475,5,-3" mass='10000'>
     358                                                <attached>
     359                                                                                                        <!-- L1.6 -->
     360                                                        <Model mesh="Rohr.mesh" position="0,0,-12" scale=10 roll=90 yaw=90 pitch=-90/> 
     361                                                </attached>
     362                                        </SOBTube>
     363                                       
     364                                                <Model mesh="Cube1.1.mesh" position="250,0,20" scale=10/>                                                                                       <!-- L1.7 -->
    319365                                        <!-- Rohre-->
    320                                         <Model mesh="Rohr.mesh" position="295,5,-35" scale=10 roll=90 yaw=90 pitch=-90/>                                                <!-- L1.8 -->
    321                                         <Model mesh="Rohr.mesh" position="395,5,-25" scale=10 roll=90 yaw=90 pitch=-90/>                                                <!-- L1.9 -->
    322                                         <Model mesh="Rohr.mesh" position="475,5,-15" scale=10 roll=90 yaw=90 pitch=-90 />                                               <!-- L1.10 -->
    323                                         <Model mesh="Rohr.mesh" position="585,5,-15" scale=10 roll=90 yaw=90 pitch=-90 />                                               <!-- L1.11 --> 
     366                                                                                <!-- L1.8 -->
     367                                                                        <!-- L1.11 --> 
    324368
    325369                                        <SOBQBlock collisionType="static" type="Mushroom" position="650,0,30" mass='-1'>
     
    343387                                                        <BoxCollisionShape position="210,0,20" halfExtents="5,5,5" />                                           <!-- 1.3 -->
    344388                                                        <BoxCollisionShape position="230,0,20" halfExtents="5,5,5" />                                           <!-- 1.5 -->
    345                                                         <BoxCollisionShape position="250,0,20" halfExtents="5,5,5" />                                           <!-- 1.7 -->
    346                                                        
    347 
    348                                                 </collisionShapes>
    349                                         </StaticEntity>
    350 
     389                                               
     390                                                        <BoxCollisionShape position="250,0,20" halfExtents="5,5,5" />                                           <!-- 1.7 -->
     391                                                       
     392
     393                                                </collisionShapes>
     394                                        </StaticEntity>
     395                                                <Model mesh="Rohr.mesh" position="395,0,-25" scale=10 roll=90 yaw=90 pitch=-90/>       
     396                                                <Model mesh="Rohr.mesh" position="585,0,-15" scale=10 roll=90 yaw=90 pitch=-90/>       
    351397
    352398                                        <StaticEntity collisionType="static" >
    353                                                 <collisionShapes>
    354                                                        
    355 
    356                                                         <BoxCollisionShape position="295,0,-4" halfExtents="12,5,12" />                                         <!-- 1.8 -->
    357                                                         <BoxCollisionShape position="395,0,1" halfExtents="12,5,17" />                                          <!-- 1.9 -->
    358                                                         <BoxCollisionShape position="475,0,6" halfExtents="12,5,22" />                                          <!-- 1.10 -->
    359                                                         <BoxCollisionShape position="585,0,6" halfExtents="12,5,22" />                                          <!-- 1.11 -->
    360 
    361                                                 </collisionShapes>
    362                                         </StaticEntity>
     399                                               
     400                                               
     401
     402                                                <collisionShapes>
     403                                                       
     404
     405                                                                                       
     406                                                        <BoxCollisionShape position="395,0,1" halfExtents="12,5,17" />                                         
     407                                                                                               
     408                                                        <BoxCollisionShape position="585,0,6" halfExtents="12,5,22" />                                         
     409
     410                                                </collisionShapes>
     411                                        </StaticEntity>
    363412
    364413
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/CMakeLists.txt

    r11783 r11987  
    33  SOBCenterpoint.cc
    44  SOB.cc
     5  SOBTube.cc
    56  SOBFigure.cc
    67  SOBItem.cc
     
    1415  SOBCoin.cc
    1516  SOBGumbaBoss.cc
     17 
    1618
    1719)
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOB.cc

    r11783 r11987  
    149149        //If player has reached end of level
    150150        if (this->figure_ != nullptr && figure_->lvlEnded_) {
    151             std::stringstream a;
     151            std::stringstream a;setLvl(2);
    152152            if(!newHighscore){
    153153                a << "Nice! " << getPoints() << " Points in " << (400-getTimeLeft())/2 <<"s.\n\nPress <Space> to restart";
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOBFigure.cc

    r11783 r11987  
    4343#include <OgreMath.h>
    4444
     45#include "SOBTube.h"
    4546#include "SOBMushroom.h"
    4647#include "SOBGumba.h"
     
    5051#include "SOBFlagstone.h"
    5152#include "SOBCastlestone.h"
    52 #include "SOBFireball.h"
    5353#include "Highscore.h"
    5454#include <BulletCollision/NarrowPhaseCollision/btManifoldPoint.h>
     
    7272        firePressed_        = false;
    7373        collDisZ_           = 0;
    74 
     74        tube                = NULL;
     75
     76        //Variables for Action in Tube
     77        tcol_               = false;
     78        tubing              = false;
     79        kkk                 = 0;
     80       
    7581        //Times and turning
    7682        timeSinceLastFire_  = 0.0;
     
    8995        reachedLvlEndState_ = 0;
    9096
     97        positiontube_=10000;
    9198        // Properties concerning PowerUps and items
     99       
    92100        PowerUpCounter_     = 0;
    93101        maxPowerUp_         = 2;
     
    112120
    113121        //Orxocast returns object with casted type if otherObject has that class, and if not a nullptr
     122        //SOBTube* test;
     123       
    114124        SOBMushroom*    mush        = orxonox_cast<SOBMushroom*>    (otherObject);
     125        tube                        = orxonox_cast<SOBTube*>        (otherObject);
    115126        SOBGumba*       gumba       = orxonox_cast<SOBGumba*>       (otherObject);
    116127        SOBGumbaBoss*   gumbaBoss   = orxonox_cast<SOBGumbaBoss*>   (otherObject);
     
    121132
    122133
     134
    123135        //Check if otherObject is a powerup-mushroom
    124136        if (mush != nullptr && !(mush->hasCollided_)) {
     
    133145           
    134146           
    135         }
    136 
    137        
    138 
    139         //Check if otherObject is a Gumba (that walking enemies)
    140 
    141          else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {
     147        }else if(tube != nullptr && !(tube->hasCollided_)){ //Check if other Object is a tube and set position wher tube is in positiontube_
     148            tube->hasCollided_=true;positiontube_=getPosition().x;tcol_=true; //tcol_ used for movedown function in SOBfigure.cc
     149               
     150
     151
     152        }else if (gumba != nullptr && gumbaBoss == nullptr && !(gumba->hasCollided_)) {
     153            //Check if otherObject is a Gumba (that walking enemies)
    142154
    143155            //If player jumps on its head, kill the Gumba, else, kill the player
     
    209221    return 1;
    210222}
    211 
     223/*bool SOBFigure::tubeAction(){
     224return true;
     225}*/
    212226//Function to spawn the Fireball
    213227void SOBFigure::spawnFireball() {
     
    240254{
    241255    SUPER(SOBFigure, tick, dt);
    242 
     256   
    243257
    244258    bool inputAllowed = true;
    245     //SOB* SOBGame = orxonox_cast<SOB*>(getGametype());
     259   
    246260
    247261    //the particle spawner that generates the fire from the backpack when pressed
     
    291305            velocity.y = 0;
    292306        //If player falls in a hole
    293         if (position.z < -100) {
     307        if (position.z < -180) {
    294308            dead_ = true;
    295309            SOBGame->setDone(true);
     
    355369
    356370        //If moveUp pressed, fire a fireball
    357         if(moveUpPressed_ && (PowerUpCounter_ >= FireballPower) && fireallowed_)
     371        if(moveUpPressed_ && inputAllowed) //if pressed up jump through tube if you are underground
    358372        {
     373            Vector3 position1 = getPosition();
     374
     375             
     376               
     377               
     378                if(position1.z>=-100 && position1.z<=-40){
     379                    position1.z=40;
     380                    if(460<=position1.x && position1.x<480){setPosition(position1);}  //little hack works without this but first tube must be touched     //position where second tube is
     381                    if(positiontube_-10<=position1.x && position1.x<positiontube_+10){      //function for jumping through any SOBtube`s
     382                    setPosition(position1);}}
     383
     384
     385            if((PowerUpCounter_ >= FireballPower) && fireallowed_){
    359386            spawnFireball();
     387
    360388            fireallowed_  = false;
    361             firecooldown_ = 0;
     389            firecooldown_ = 0;}
     390        }
     391       
     392         if(moveDownPressed_ && inputAllowed ){ //if movedownpressed change collisiontype of tube and slip through tube
     393               
     394             
     395                Vector3 position1 = getPosition();
     396             
     397
     398               
     399           
     400               if(tube != nullptr && !(tube->movedown)){ //Check if other Object is a tube
     401               
     402                if(positiontube_-10<position1.x && position1.x<positiontube_+10){
     403                tube->movedown=true;}
     404                }
     405   
    362406        }
    363407
     
    419463    moveLeftPressed_    = false;
    420464    moveRightPressed_   = false;
     465   
    421466
    422467    isColliding_ = false;
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOBFigure.h

    r11783 r11987  
    3232#include "superorxobros/SOBPrereqs.h"
    3333#include "worldentities/ControllableEntity.h"
     34#include "SOBTube.h"
    3435
    3536
     
    5859            //Soooo many declarations
    5960            bool fireallowed_;
    60 
    61             bool moveUpPressed_;
     61            SOBTube*       tube; //class SOBTube* used because tube needs to be global using in collides against function and tick function in SOBfigure.cc
     62            bool moveUpPressed_;
     63            int kkk;
     64           
     65            bool tcol_;  //used for getting through tube
     66            bool tubing; //used for getting through tube
    6267            bool moveDownPressed_;
    6368            bool moveLeftPressed_;
     
    6873            float lastSpeed_z;
    6974            float firecooldown_;
     75            float positiontube_;
    7076            bool isColliding_;
    7177            WorldEntity* particlespawner_;
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOBGumba.cc

    r11783 r11987  
    106106    {
    107107        SUPER(SOBGumba, tick, dt);
    108 
     108       
    109109        if (!changeAllowed_) {
    110110            changedOn_+= dt;
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOBItem.h

    r11783 r11987  
    4949            virtual void setFigure(SOBFigure* newFigure);
    5050            virtual  bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* ownCollisionShape, btManifoldPoint& contactPoint) override;
    51 
    5251         
    5352            bool attachedToFigure_;
  • code/branches/SuperOrxoBros_FS18/src/modules/superorxobros/SOBPrereqs.h

    r11783 r11987  
    8080    class SOBCastlestone;
    8181    class SOBCoin;
     82    class SOBTube;
    8283
    8384}
Note: See TracChangeset for help on using the changeset viewer.