Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11322


Ignore:
Timestamp:
Dec 5, 2016, 4:15:27 PM (7 years ago)
Author:
bberabi
Message:

we found how to set starpositions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/SpaceRace_HS16/src/modules/gametypes/SpaceRace.cc

    r11312 r11322  
    5252#include "SpaceRaceBot.h"
    5353#include "items/Engine.h"
     54#include <vector>
     55
    5456
    5557namespace orxonox
     
    7880    void SpaceRace::start()
    7981    {
     82
     83
     84        std::vector<int> spawnpositions;
     85       
     86        spawnpositions.push_back(200);
     87        spawnpositions.push_back(0);
     88        spawnpositions.push_back(100);
     89       
     90        spawnpositions.push_back(200);
     91        spawnpositions.push_back(200);
     92        spawnpositions.push_back(0);
     93       
     94        spawnpositions.push_back(200);
     95        spawnpositions.push_back(0);
     96        spawnpositions.push_back(0);
     97
     98        spawnpositions.push_back(100);
     99        spawnpositions.push_back(0);
     100        spawnpositions.push_back(0);
     101
     102        spawnpositions.push_back(0);
     103        spawnpositions.push_back(100);
     104        spawnpositions.push_back(0);
     105
     106
    80107        Gametype::start();
    81108   if (true)
     
    89116
    90117            }
    91            
    92         }
    93 
    94 
    95 
     118           
     119           int a,b,c;
     120            a=0;
     121            b=1;
     122            c=2;
     123              for (SpaceRaceBot* bot : ObjectList<SpaceRaceBot>()){
     124                bot->getControllableEntity()->setPosition(spawnpositions.at(a),spawnpositions.at(b),spawnpositions.at(c));
     125               a= a+3;
     126               b = b+3;
     127               c+= 3;
     128            }
     129
     130
     131        }
     132
     133
     134               
    96135        std::string message("BE FAST BE FIRST");
    97136        this->getGametypeInfo()->sendAnnounceMessage(message);
     
    137176
    138177
    139        /* // spawns the players when the countdown starts, but deactivates their engines
    140         if (this->isStartCountdownRunning() && !this->cantMove_)
     178        // spawns the players when the countdown starts, but deactivates their engines
     179       /* if (this->isStartCountdownRunning() && !this->cantMove_)
    141180        {
    142181            this->spawnPlayersIfRequested();
     
    145184            for (Engine* engine : ObjectList<Engine>())
    146185                engine->setActive(false);
    147         }
    148 
    149 
    150 gtinfo_->setStartCountdown(50.0);
     186        }*/
     187
     188
     189//gtinfo_->setStartCountdown(50.0);
    151190   
    152191       
     
    159198
    160199        // activate the engines when the countdown ends
    161         if (!this->isStartCountdownRunning() && this->cantMove_)
     200      /*  if (!this->isStartCountdownRunning() && this->cantMove_)
    162201        {
    163202            for (Engine* engine : ObjectList<Engine>())
     
    218257 void SpaceRace::addBots(unsigned int amount)
    219258    {
    220         for (unsigned int i = 1; i <= amount/2; ++i){
     259        for (unsigned int i = 1; i <= amount; ++i){
    221260            this->botclass_.fabricate(this->getContext());
    222261            //SpaceRaceBot* bot = new SpaceRaceBot(this->getContext());
    223262            //bot->setPosition(-i*150,0,-i*100);
    224263        }
    225         for (unsigned int i = 1; i <= amount/2; ++i){
    226             this->botclass_.fabricate(this->getContext());
    227             //SpaceRaceBot* bot = new SpaceRaceBot(this->getContext());
    228             //bot->setPosition(-i*150,0,i*100);
    229         }
     264
    230265
    231266
Note: See TracChangeset for help on using the changeset viewer.