Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 26, 2014, 3:59:37 PM (10 years ago)
Author:
sriedel
Message:

Working version, Blockpattern are strange.

Location:
code/branches/surfaceraceHS14
Files:
1 added
5 edited

Legend:

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

    r10128 r10135  
    1515  include("templates/spaceshipDodgeRace.oxt")
    1616  include("templates/enemyInvader.oxt")
     17  include("templates/DodgeRacePattern.oxt")
    1718  include("overlays/InvaderHUD.oxo")
    1819?>
     
    3839
    3940    <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
    40     <Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
     41    <Light type=directional position="-100, 10000, -700" lookat="0.2, -1, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    4142    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=DodgeRaceShip pawndesign=spaceshipdodgerace />
    4243
     
    4748   
    4849   
    49   <StaticEntity position="1500,0,50" direction="0,0,0"   scale="1" collisionType=static mass=0 friction=0.01 >
     50  <StaticEntity position="1500,40,50" direction="0,0,0"   scale="1" collisionType=static mass=0 friction=0.01 >
    5051      <attached>
    5152        <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" />
     
    5758
    5859  </StaticEntity>
    59   <StaticEntity position="4500,0,-30" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
     60  <StaticEntity position="4500,50,-30" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
    6061      <attached>
    61         <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" />
     62        <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,40,50" />
    6263      </attached>
    6364
    6465      <collisionShapes>
    6566        <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" />
     74      </attached>
     75
     76      <collisionShapes>
     77        <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
    6678      </collisionShapes>
    6779
  • code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt

    r10128 r10135  
    6969  <DodgeRaceShip>
    7070    <camerapositions>
    71       <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
     71      <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true />
     72      <CameraPosition position="0,100,180" direction="0, -0.2, -1" drag=false mouselook=true />
    7273      <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
    7374    </camerapositions>
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc

    r10124 r10135  
    5858        multiplier = 1;
    5959        b_combo = false;
    60 
     60        counter = 0;
     61        lastPosition = 0;
    6162        // spawn enemy every 3.5 seconds
    6263        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
     
    8182        toggleShowLevel();
    8283        showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
     84    }
     85
     86    void DodgeRace::tick(float dt)
     87    {
     88        if (getPlayer() != NULL)
     89        {
     90                        //WeakPtr<DodgeRaceShip> ship = getPlayer();
     91
     92                        currentPosition = getPlayer()->getWorldPosition().x;
     93                        counter = counter + (currentPosition - lastPosition);
     94                        lastPosition = currentPosition;
     95
     96                        if(counter >= 5000)
     97                        {
     98                                counter = 0;
     99
     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);
     105                        }
     106        }
     107        SUPER(DodgeRace, tick, dt);
    83108    }
    84109
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.h

    r10124 r10135  
    7474            virtual void end();
    7575
     76            virtual void tick(float dt);
     77
    7678            void levelUp();
    7779
     
    9395            int lives;
    9496            int multiplier;
     97            int counter;
     98            int currentPosition;
     99            int lastPosition;
    95100
    96101       private:
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc

    r10128 r10135  
    4242        RegisterObject(DodgeRaceShip);
    4343
    44         speed = 500;
     44        speed = 800;
    4545        isFireing = false;
    4646        damping = 10;
     
    8282                    }
    8383            }
     84            /*
    8485            if (pos.z + dist_x > 42*2.5 || pos.z + dist_x < -42*3)
    85                 velocity.x = 0;
     86            {
     87                velocity.x = 0;
     88            }
     89            */
    8690            pos += Vector3(1000 + velocity.y, 0, velocity.x) * dt;
    8791        }
     
    99103        if (camera != NULL)
    100104        {
    101             camera->setPosition(Vector3(-pos.z, -posforeward, 0));
     105            // camera->setPosition(Vector3(-pos.z, -posforeward, 0));
    102106            camera->setOrientation(Vector3::UNIT_Z, Degree(0));
    103107        }
     
    145149    void DodgeRaceShip::boost(bool bBoost)
    146150    {
    147         isFireing = bBoost;
     151        //isFireing = bBoost;
    148152    }
    149153
    150154    inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    151155    {
     156        /*
    152157        if (otherObject != NULL && lastEntity != otherObject)
    153158        {
    154159                lastEntity = otherObject;
    155160                removeHealth(20);
    156             //this->death();
    157161        }
     162                */
    158163
     164
     165        this->death();
    159166        return false;
    160167    }
Note: See TracChangeset for help on using the changeset viewer.