Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10152


Ignore:
Timestamp:
Dec 3, 2014, 5:18:24 PM (9 years ago)
Author:
sriedel
Message:

Almost there. Death doesnt work

Location:
code/branches/surfaceraceHS14
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw

    r10135 r10152  
    2626
    2727  <Scene
    28     ambientlight = "2.0, 2.0, 2.0"
     28    ambientlight = "1.0, 1.0, 1.0"
    2929    skybox       = "Orxonox/skyBoxClouds"
    3030    negativeWorldRange = "-100000, -100000, -100000"
     
    4646
    4747    <DodgeRaceCenterPoint name=invadercenter />
    48    
    49    
    50   <StaticEntity position="1500,40,50" direction="0,0,0"   scale="1" collisionType=static mass=0 friction=0.01 >
     48 
     49  <StaticEntity position="0,-50,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
    5150      <attached>
    52         <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" />
    53       </attached>
    54 
    55       <collisionShapes>
    56         <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" />
    57       </collisionShapes>
    58 
    59   </StaticEntity>
    60   <StaticEntity position="4500,50,-30" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
    61       <attached>
    62         <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,40,50" />
    63       </attached>
    64 
    65       <collisionShapes>
    66         <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" />
    67       </collisionShapes>
    68 
    69   </StaticEntity>
    70  
    71   <StaticEntity position="0,-10,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
    72       <attached>
    73         <Model position="0,0,0" mesh="CubeGround.mesh" scale3D="100000,2,100000" />
     51        <Model position="0,0,0" mesh="plane.mesh" scale3D="100000,0,100000" />
    7452      </attached>
    7553
  • code/branches/surfaceraceHS14/data/levels/templates/DodgeRacePattern.oxt

    r10139 r10152  
    1 <Template name=DodgeRaceCube02>
     1<Template name=DodgeRaceCube01>
    22 
    3         <StaticEntity position="0,0,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
     3        <DodgeRaceCube position="0,0,0" direction="0,0,0"   scale="1" collisionType=dynamic mass=1 friction=0.01 >
    44      <attached>
    5         <Model position="0,0,0"         mesh="blackcube.mesh"           scale3D="600,50,50" />
    6                 <Model position="0,0,950"       mesh="blackcube.mesh"           scale3D="600,50,50" />
    7                 <Model position="800,0,50"      mesh="blackcube.mesh"           scale3D="100,50,100" />
    8                 <Model position="800,0,850"     mesh="blackcube.mesh"           scale3D="100,50,100" />
    9                 <Model position="850,0,250"     mesh="blackcube.mesh"           scale3D="50,40,100" />
    10                 <Model position="850,0,450"     mesh="blackcube.mesh"           scale3D="50,40,100" />
    11                 <Model position="850,0,650"     mesh="blackcube.mesh"           scale3D="50,40,100" />
     5        <Model position="700,0,50"              mesh="CuboidBody.mesh"          scale3D="300,50,50"     />
     6                <Model position="700,0,1150"    mesh="CuboidBody.mesh"          scale3D="300,50,50"     />
     7                <Model position="1200,0,200"    mesh="CuboidBody.mesh"          scale3D="100,50,100"    />
     8                <Model position="1200,0,1000"   mesh="CuboidBody.mesh"          scale3D="100,50,100"    />
     9                <Model position="1250,-10,430"  mesh="CuboidBody.mesh"          scale3D="50,40,30"              />
     10                <Model position="1250,-10,600"  mesh="CuboidBody.mesh"          scale3D="50,40,30"              />
     11                <Model position="1250,-10,770"  mesh="CuboidBody.mesh"          scale3D="50,40,30"              />
     12                <Model position="1650,0,350"    mesh="CuboidBody.mesh"          scale3D="50,50,150"     />
     13                <Model position="1650,0,850"    mesh="CuboidBody.mesh"          scale3D="50,50,150"     />
     14                <Model position="2100,0,150"    mesh="CuboidBody.mesh"          scale3D="100,50,150"    />
     15                <Model position="2100,0,1050"   mesh="CuboidBody.mesh"          scale3D="100,50,150"    />
     16                <Model position="2150,0,600"    mesh="CuboidBody.mesh"          scale3D="50,50,100"             />
    1217      </attached>
    1318
    1419      <collisionShapes>
    15         <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
     20                <BoxCollisionShape position="700,0,50"                          halfExtents="300,50,50"         />
     21                <BoxCollisionShape position="700,0,1150"                        halfExtents="300,50,50"         />
     22                <BoxCollisionShape position="1200,0,200"                        halfExtents="100,50,100"        />
     23                <BoxCollisionShape position="1200,0,1000"                       halfExtents="100,50,100"        />
     24                <BoxCollisionShape position="1250,-10,430"                      halfExtents="50,40,30"          />
     25                <BoxCollisionShape position="1250,-10,600"                      halfExtents="50,40,30"          />
     26                <BoxCollisionShape position="1250,-10,770"                      halfExtents="50,40,30"          />
     27                <BoxCollisionShape position="1650,0,350"                        halfExtents="50,50,150"         />
     28                <BoxCollisionShape position="1650,0,850"                        halfExtents="50,50,150"         />
     29                <BoxCollisionShape position="2100,0,150"                        halfExtents="100,50,150"        />
     30                <BoxCollisionShape position="2100,0,1050"                       halfExtents="100,50,150"        />
     31                <BoxCollisionShape position="2150,0,600"                        halfExtents="50,50,100"         />
    1632      </collisionShapes>
    17         </StaticEntity>
     33        </DodgeRaceCube>
    1834
    1935</Template>
    2036
    21 <Template name=DodgeRaceCube01>
     37<Template name=DodgeRaceCube02>
    2238 
    23         <StaticEntity position="0,0,0" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
     39        <DodgeRaceCube position="0,0,0" direction="0,0,0"   scale="1" collisionType=dynamic mass=1 friction=0.01 >
    2440      <attached>
    25         <Model position="0,0,0"         mesh="blackcube.mesh"           scale3D="50,50,100" />
    26                 <Model position="50,0,150"      mesh="blackcube.mesh"           scale3D="50,50,50" />
    27                 <Model position="40,0,-155"     mesh="blackcube.mesh"           scale3D="50,50,50" />
     41                <Model position="450,0,300"     mesh="CuboidBody.mesh"          scale3D="50,50,300"     />
     42                <Model position="950,0,850"     mesh="CuboidBody.mesh"          scale3D="50,50,350"     />
     43                <Model position="1350,0,200"    mesh="CuboidBody.mesh"          scale3D="50,50,200"     />
     44                <Model position="1350,0,700"    mesh="CuboidBody.mesh"          scale3D="50,50,100"     />
     45                <Model position="1750,0,350"    mesh="CuboidBody.mesh"          scale3D="50,50,350"     />
     46                <Model position="2000,0,1000"   mesh="CuboidBody.mesh"          scale3D="100,50,100"    />
     47                <Model position="1650,0,1150"   mesh="CuboidBody.mesh"          scale3D="450,50,50"     />
    2848      </attached>
    2949
    3050      <collisionShapes>
    31         <BoxCollisionShape position="0,1000,0" halfExtents="1,1,1" />
     51                <BoxCollisionShape position="450,0,300"                                 halfExtents="50,50,300"         />
     52                <BoxCollisionShape position="950,0,850"                         halfExtents="50,50,350"         />
     53                <BoxCollisionShape position="1350,0,200"                        halfExtents="50,50,200"         />
     54                <BoxCollisionShape position="1350,0,700"                                halfExtents="50,50,100"         />
     55                <BoxCollisionShape position="1750,0,350"                        halfExtents="50,50,350"         />
     56                <BoxCollisionShape position="2000,0,1000"                       halfExtents="100,50,100"        />
     57                <BoxCollisionShape position="1650,0,1150"                       halfExtents="450,50,50"         />
    3258      </collisionShapes>
    33         </StaticEntity>
     59        </DodgeRaceCube>
    3460
    3561</Template>
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/CMakeLists.txt

    r10118 r10152  
    33DodgeRaceCenterPoint.cc
    44DodgeRaceShip.cc
     5DodgeRaceCube.cc
    56DodgeRaceHUDinfo.cc
    67)
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc

    r10135 r10152  
    3434#include "DodgeRace.h"
    3535#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
     36#include "DodgeRaceCube.h"
    3637
    3738namespace orxonox
     
    5960        b_combo = false;
    6061        counter = 0;
     62        pattern = 1;
    6163        lastPosition = 0;
    6264        // spawn enemy every 3.5 seconds
     
    9496                        lastPosition = currentPosition;
    9597
    96                         if(counter >= 5000)
     98                        for(int i=0; i< cubeList.size();i++)
     99                        {
     100                                if(cubeList.at(i)->getPosition().x < currentPosition-3000)
     101                                {
     102                                        cubeList.at(i)->destroy();
     103                                        cubeList.erase(cubeList.begin()+i);
     104                                }
     105                        }
     106
     107                        if(counter >= 3000)
    97108                        {
    98109                                counter = 0;
    99110
    100                                 WeakPtr<StaticEntity> stentity = new StaticEntity(this->center_->getContext()); //this->center_->getContext()
    101                                 stentity->addTemplate("DodgeRaceCube01");
    102 
    103                                 stentity->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, 0));
    104                                 //stentity->setScale3D(50,50,50);
     111                                for(int i = 0; i<6; i++)
     112                                {
     113                                        WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
     114                                        cubeList.push_back(cube);
     115                                        switch(pattern)
     116                                        {
     117                                        case 1: cube->addTemplate("DodgeRaceCube01");
     118                                        break;
     119                                        case 2: cube->addTemplate("DodgeRaceCube02");
     120                                        break;
     121
     122                                        }
     123
     124                                        cube->setPosition(getPlayer()->getWorldPosition() + Vector3(5000, 0, -3600 + (i*1200)));
     125                                        //stEntity->setScale3D(50,50,50);
     126                                }
     127
     128
     129                                pattern %= 2;
     130                                pattern ++;
     131
    105132                        }
     133
    106134        }
    107135        SUPER(DodgeRace, tick, dt);
     
    166194    void DodgeRace::start()
    167195    {
     196        orxout() << "start function called." << endl;
    168197        init();
     198                for(int i=0; i< cubeList.size();i++)
     199                {
     200                        cubeList.at(i)->destroy();
     201                        cubeList.erase(cubeList.begin()+i);
     202
     203                }
     204        cubeList.clear();
    169205        // Set variable to temporarily force the player to spawn.
    170206        this->bForceSpawn_ = true;
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h

    r10135 r10152  
    5151#include "gamestates/GSLevel.h"
    5252#include "chat/ChatManager.h"
     53#include <vector>
    5354
    5455// ! HACK
     
    9697            int multiplier;
    9798            int counter;
     99            int pattern;
    98100            int currentPosition;
    99101            int lastPosition;
     
    102104            WeakPtr<DodgeRaceShip> getPlayer();
    103105            WeakPtr<DodgeRaceShip> player;
     106            std::vector<DodgeRaceCube*> cubeList;
    104107            void toggleShowLevel(){bShowLevel = !bShowLevel;}
    105108            void addPoints(int numPoints);
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRacePrereqs.h

    r10118 r10152  
    7171    class DodgeRaceCenterPoint;
    7272    class DodgeRaceShip;
     73    class DodgeRaceCube;
    7374    //class DodgeRaceEnemy;
    7475    //class DodgeRaceEnemyShooter;
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc

    r10135 r10152  
    7575                velocity.y = 0;
    7676                // restart if game ended
     77                /*
    7778                if (getGame())
    7879                    if (getGame()->bEndGame)
     
    8081                        getGame()->start();
    8182                        return;
    82                     }
     83                    }*/
    8384            }
    8485            /*
Note: See TracChangeset for help on using the changeset viewer.