Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 20, 2017, 1:06:08 PM (7 years ago)
Author:
pascscha
Message:

death message initiated

Location:
code/branches/FlappyOrx_HS17
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/data/levels/FlappyOrx.oxw

    r11554 r11563  
    4242
    4343    <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
    44     <Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
     44    <Light type=directional position="11000, 11000, -7000" lookat="0, 0, 0" diffuse="1, 1, 1, 1" specular="1.0, 0.9, 0.9, 1.0" />
    4545    <SpawnPoint team=0 position="0,0,0" lookat="0,0,0" spawnclass=FlappyOrxShip pawndesign=spaceshipFlappyOrx />
    4646
  • code/branches/FlappyOrx_HS17/data/overlays/FlappyOrxHUD.oxo

    r11533 r11563  
    1515     align     = "left"
    1616
    17      showlives     = false
    1817     showpoints     = true
     18    />
     19
     20    <FlappyOrxHUDinfo
     21     position  = "0.02, 0.01"
     22     pickpoint = "0.0, 0.0"
     23     font      = "ShareTechMono"
     24     textsize  = 0.04
     25     colour    = "1.0, 1.0, 1.0, 1.0"
     26     align     = "left"
     27
     28     showmessage     = true
    1929    />
    2030
     
    2636     colour    = "1.0, 1.0, 1.0, 1.0"
    2737     align     = "left"
    28      caption   = "Points: "
     38     caption   = "Score: "
    2939    />
    3040    <!-- <FlappyOrxHUDinfo
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc

    r11554 r11563  
    5151#include "core/command/ConsoleCommand.h"
    5252#include "worldentities/ExplosionPart.h"
     53
    5354
    5455namespace orxonox
     
    198199    };
    199200
     201    bool FlappyOrx::isDead(){
     202        return true;
     203    }
     204
     205    std::string FlappyOrx::getDeathMessage(){
     206        return "hello world";
     207    }
     208
    200209    void FlappyOrx::comboControll()
    201210    {
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h

    r11537 r11563  
    8888            // checks if multiplier should be reset.
    8989            void comboControll();
     90
     91            bool isDead();
     92            std::string getDeathMessage();
     93
    9094            int lives;
    9195            int multiplier;
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.cc

    r11533 r11563  
    4545        this->bShowPoints_ = false;
    4646        this->bShowMultiplier_ = false;
     47        this->bShowGameOver_ = false;
     48        this->sGameOverMessage_ = "";
    4749    }
    4850
     
    5254
    5355        XMLPortParam(FlappyOrxHUDinfo, "showlives",     setShowLives,     getShowLives,     xmlelement, mode).defaultValues(false);
    54         XMLPortParam(FlappyOrxHUDinfo, "showPoints",     setShowPoints,     getShowPoints,     xmlelement, mode).defaultValues(false);
     56        XMLPortParam(FlappyOrxHUDinfo, "showpoints",    setShowPoints,    getShowPoints,    xmlelement, mode).defaultValues(false);
     57        XMLPortParam(FlappyOrxHUDinfo, "showmessage",   setShowMessage,   getShowMessage,   xmlelement, mode).defaultValues(false);
    5558       
    5659   
     
    7174            {
    7275                const std::string& points = multi_cast<std::string>(this->FlappyOrxGame->getPoints());
    73                 if (this->FlappyOrxGame->lives <= 0)
    74                 {
    75                     setTextSize(0.2);
    76                     setPosition(Vector2(0.1, 0.02));
    77                     this->setCaption("Final score:\n" + points);
    78                     this->setColour(ColourValue(1, 0, 0, 1));
    79                 }
    80                 else
     76                if (not this->FlappyOrxGame->isDead())
    8177                {
    8278                    setTextSize(0.04);
     
    8581                    this->setCaption(points);
    8682                }
     83            }
     84            if(this->bShowGameOver_){
     85                if(this->FlappyOrxGame->isDead()){
     86                    std::string message = this->FlappyOrxGame->getDeathMessage();
     87                    setTextSize(0.4);
     88                    setPosition(Vector2(.5, .5));
     89                    this->setCaption(message);
     90                    this->setColour(ColourValue(1, 0, 0, 1));
     91                }
     92
    8793            }
    8894           
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.h

    r11521 r11563  
    3232#include "tools/interfaces/Tickable.h"
    3333#include "overlays/OverlayText.h"
     34#include <cstring>
    3435
    3536namespace orxonox
     
    6465                { return this->bShowMultiplier_; }
    6566
     67            inline void setShowMessage(bool value){
     68                bShowGameOver_ = value;
     69            }
     70            inline bool getShowMessage() const
     71                { return this->bShowGameOver_; }
     72
    6673
    6774        private:
     
    7178            bool bShowPoints_;
    7279            bool bShowMultiplier_;
     80            bool bShowGameOver_;
     81            std::string sGameOverMessage_;
    7382    };
    7483}
Note: See TracChangeset for help on using the changeset viewer.