Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 4, 2017, 4:17:43 PM (6 years ago)
Author:
vyang
Message:

Asteroiden werden generiert und bewegen sich, HUD muss noch angepasst werden, Punkte und Health und Leben anzeigen. Raumschiff kann noch nicht schiessen, evtl auch Schutzfunktion → nachdem ein Leben verloren wurde 2s Immunitaet?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Asteroid_HS17/src/modules/asteroids2D/Asteroids2DHUDinfo.cc

    r11608 r11637  
    4141
    4242        this->Asteroids2DGame = nullptr;
     43        this->Ship = nullptr;
    4344        this->bShowPoints_ = true;
     45        this->bShowHealth_ = true;
    4446    }
    4547
     
    4951
    5052        XMLPortParam(Asteroids2DHUDinfo,"showPoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
     53        XMLPortParam(Asteroids2DHUDinfo,"showHealth", setShowHealth, getShowHealth, xmlelement, mode).defaultValues(false);
    5154    }
    5255
     
    7477            }
    7578        }
     79
     80        /*if(this->bShowHealth_)
     81        {
     82            const std::string& health = multi_cast<std::string>(this->Ship->getHealth());
     83            if (this->Asteroids2DGame->lives <= 0)
     84            {
     85                setTextSize(0.2);
     86                setPosition(Vector2(0.1, 0.02));
     87                this->setCaption("Final score:\n" + health);
     88                this->setColour(ColourValue(1, 0, 0, 1));
     89            }
     90            else
     91            {
     92                setTextSize(0.04);
     93                setPosition(Vector2(0.2, 0.02));
     94                this->setColour(ColourValue(1, 1, 1, 1));
     95                this->setCaption(health);
     96            }
     97        }*/
    7698    }
    7799
     
    80102        SUPER(Asteroids2DHUDinfo, changedOwner);
    81103
    82         if (this->getOwner() && this->getOwner()->getGametype())
     104        if (this->getOwner() && this->getOwner()->getGametype())//&& this->getOwner->getPlayer())
    83105        {
    84106            this->Asteroids2DGame = orxonox_cast<Asteroids2D*>(this->getOwner()->getGametype());
     107            //this->Ship = orxonox_cast<Asteroids2DShip*>(this->getOwner()->getPlayer());
    85108        }
    86109        else
Note: See TracChangeset for help on using the changeset viewer.