Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2017, 2:03:45 PM (8 years ago)
Author:
pascscha
Message:

cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc

    r11576 r11595  
    4040#include "weapons/projectiles/Projectile.h"
    4141#include <math.h>
     42#include <ctime>
    4243
    4344namespace orxonox
     
    5354        this->gravity = 1;
    5455        isDead = true;
     56        deathTime = 0;
    5557       
    5658    }
     
    128130    void FlappyOrxShip::moveRightLeft(const Vector2& value){}
    129131
     132    int FlappyOrxShip::timeUntilRespawn(){
     133        return 2-time(0)+deathTime;
     134    }
     135
    130136    void FlappyOrxShip::boost(bool boost){
    131         if(isDead){
     137
     138   
     139        if(isDead&&timeUntilRespawn()<=0){
    132140            isDead = false;
    133141            getGame()->setDead(false);
     
    156164    {
    157165        isDead = true;
     166
     167        deathTime = time(0);
     168
     169        orxout()<<"death time: "<<deathTime<<std::endl;
    158170        Vector3 pos = getPosition();
    159171        pos.x = 0;
Note: See TracChangeset for help on using the changeset viewer.