Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 25, 2013, 6:51:39 PM (10 years ago)
Author:
zifloria
Message:

points, level up, hud

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/invaders/src/modules/invader/InvaderShip.cc

    r9828 r9829  
    3636#include "core/CoreIncludes.h"
    3737#include "core/XMLPort.h"
     38#include "Invader.h"
    3839
    3940namespace orxonox
     
    120121    {
    121122        lastTime = 0;
     123        if (getGame())
     124        {
     125            getGame()->levelUp();
     126            // SmartPtr<Invader> game = orxonox_cast<Invader>(getGametype());
     127           
     128        }
    122129        //level++
    123130    }
     
    151158            {
    152159                orxout() << "DIED!!!! " << endl;
     160                if (getGame())
     161                {
     162                    getGame()->costLife();
     163                    // SmartPtr<Invader> game = orxonox_cast<Invader>(getGametype());
     164                   
     165                }
    153166            }
    154167            return false;
     
    157170        // SUPER(InvaderShip, collidesAgainst, otherObject, contactPoint);
    158171    }
     172
     173    WeakPtr<Invader> InvaderShip::getGame()
     174    {
     175        if (game == NULL)
     176        {
     177            for (ObjectList<Invader>::iterator it = ObjectList<Invader>::begin(); it != ObjectList<Invader>::end(); ++it)
     178                game = *it;
     179        }
     180        return game;
     181    }
    159182}
Note: See TracChangeset for help on using the changeset viewer.