Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 28, 2018, 11:50:16 AM (5 years ago)
Author:
stadlero
Message:

Wagnis class wip

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc

    r12119 r12124  
    1414    RegisterObject(Wagnis);
    1515    this->gameBoard = nullptr;
     16    this->gameStage = NOT_READY;
     17
     18    int n = 3;
     19    for(int i = 1;i <= n;i++){
     20        WagnisPlayer* p = new WagnisPlayer(context);
     21        p->gameBoard = this->gameBoard;
     22        this->players.push_back(p);
     23    }
    1624}
    1725//Destructor
     
    2129//Runs the game
    2230void Wagnis::start(){
    23    
     31    //SUPER(Wagnis,start);
     32    this->createGame();
     33}
     34
     35//Tick
     36void Wagnis::tick(float dt){
     37    SUPER(Wagnis,tick,dt);
    2438}
    2539
    2640//Creates and links all needed classes
    27 void createGame(){
     41void Wagnis::createGame(){\
     42    orxout() << "Game creation started";
    2843
     44    if(!findGameBoard()){
     45        orxout() << "Error: GameBoard not found";
     46    }
     47
     48    this->gameBoard->initializeNeighbors();
     49    orxout() << "Game creation finished";
    2950}
    3051
     52//Finds the pointer to the gameBoard
     53bool Wagnis::findGameBoard(){
     54    for (WagnisGameboard* gb : ObjectList<WagnisGameboard>()){
     55        this->gameBoard = gb;
     56        orxout()<<"Gameboard pointer found and added";
     57        return true;
     58    }
     59    return false;
     60}
    3161
    3262
Note: See TracChangeset for help on using the changeset viewer.