Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/dodgerace/DodgeRace.cc

    r10236 r10624  
    3535#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
    3636#include "DodgeRaceCube.h"
     37#include "core/CoreIncludes.h"
    3738
    3839namespace orxonox
     
    4344    {
    4445        RegisterObject(DodgeRace);
    45         init();
    46         this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    47         this->center_ = 0;
    48 
    49         this->setHUDTemplate("DodgeRaceHUD");
    50     }
    51 
    52     void DodgeRace::init()
    53     {
     46
    5447        bEndGame = false;
    5548        lives = 1;
     
    6558        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
    6659        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
     60        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
     61        this->center_ = 0;
     62
     63        this->setHUDTemplate("DodgeRaceHUD");
    6764    }
    6865
     
    7471            for (int i = 0; i < 7; i++)
    7572            {
    76                 WeakPtr<BigExplosion> chunk = new BigExplosion(this->center_->getContext());
     73                BigExplosion* chunk = new BigExplosion(this->center_->getContext());
    7774                chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
    7875                chunk->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
     
    9087        if (getPlayer() != NULL)
    9188        {
    92             //WeakPtr<DodgeRaceShip> ship = getPlayer();
    93 
    9489            currentPosition = getPlayer()->getWorldPosition().x;
    9590            counter = counter + (currentPosition - lastPosition);
     
    112107                for(int i = 0; i<6; i++)
    113108                {
    114                     WeakPtr<DodgeRaceCube> cube = new DodgeRaceCube(this->center_->getContext());
     109                    DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
    115110                    cubeList.push_back(cube);
    116111                    switch(pattern)
     
    137132    }
    138133
    139     WeakPtr<DodgeRaceShip> DodgeRace::getPlayer()
     134    DodgeRaceShip* DodgeRace::getPlayer()
    140135    {
    141136        if (player == NULL)
     
    168163    {
    169164        orxout() << "start" << endl;
    170         init();
    171165        for(unsigned int i=0; i< cubeList.size();i++)
    172166        {
     
    199193        /*
    200194        orxout() << "prespawn" << endl;
    201         init();
    202195        for(int i=0; i< cubeList.size();i++)
    203196        {
Note: See TracChangeset for help on using the changeset viewer.