Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11533 for code


Ignore:
Timestamp:
Nov 6, 2017, 2:12:57 PM (7 years ago)
Author:
merholzl
Message:

point system in place

Location:
code/branches/FlappyOrx_HS17
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/data/overlays/FlappyOrxHUD.oxo

    r11505 r11533  
    66<Template name="FlappyOrxHUD">
    77  <OverlayGroup name="FlappyOrxHUD" scale = "1, 1">
     8   
    89    <FlappyOrxHUDinfo
    9      position  = "0.14, 0.02"
     10     position  = "0.02, 0.01"
     11     pickpoint = "0.0, 0.0"
     12     font      = "ShareTechMono"
     13     textsize  = 0.04
     14     colour    = "1.0, 1.0, 1.0, 1.0"
     15     align     = "left"
     16
     17     showlives     = false
     18     showpoints     = true
     19    />
     20
     21    <OverlayText
     22     position  = "0.02, 0.02"
     23     pickpoint = "0.0, 0.0"
     24     font      = "ShareTechMono"
     25     textsize  = 0.04
     26     colour    = "1.0, 1.0, 1.0, 1.0"
     27     align     = "left"
     28     caption   = "Points: "
     29    />
     30    <!-- <FlappyOrxHUDinfo
     31     position  = "0.14, 0.01"
    1032     pickpoint = "0.0, 0.0"
    1133     font      = "ShareTechMono"
     
    1537
    1638     showlives     = true
    17      showlevel     = false
    1839     showpoints     = false
    1940    />
     41
    2042    <OverlayText
    21      position  = "0.02, 0.02"
     43     position  = "0.14, 0.02"
    2244     pickpoint = "0.0, 0.0"
    2345     font      = "ShareTechMono"
     
    2547     colour    = "1.0, 1.0, 1.0, 1.0"
    2648     align     = "left"
    27      caption   = "Lives:   "
    28     />
    29 
    30     <OverlayText
    31      position  = "0.02, 0.055"
    32      pickpoint = "0.0, 0.0"
    33      font      = "ShareTechMono"
    34      textsize  = 0.04
    35      colour    = "1.0, 1.0, 1.0, 1.0"
    36      align     = "left"
    37      caption   = "Level: "
    38     />
    39 
    40     <FlappyOrxHUDinfo
    41      position  = "0.14, 0.055"
    42      pickpoint = "0.0, 0.0"
    43      font      = "ShareTechMono"
    44      textsize  = 0.04
    45      colour    = "1.0, 1.0, 1.0, 1.0"
    46      align     = "left"
    47 
    48      showlives     = false
    49      showlevel     = true
    50      showpoints     = false
    51     />
    52 
    53     <OverlayText
    54      position  = "0.02, 0.1"
    55      pickpoint = "0.0, 0.0"
    56      font      = "ShareTechMono"
    57      textsize  = 0.04
    58      colour    = "1.0, 1.0, 1.0, 1.0"
    59      align     = "left"
    60      caption   = "Points: "
    61     />
    62 
    63     <FlappyOrxHUDinfo
    64      position  = "0.14, 0.1"
    65      pickpoint = "0.0, 0.0"
    66      font      = "ShareTechMono"
    67      textsize  = 0.04
    68      colour    = "1.0, 1.0, 1.0, 1.0"
    69      align     = "left"
    70 
    71      showlives     = false
    72      showlevel     = false
    73      showpoints     = true
    74     />
    75 
    76     <FlappyOrxHUDinfo
    77      position  = "0.25, 0.1"
    78      pickpoint = "0.0, 0.0"
    79      font      = "ShareTechMono"
    80      textsize  = 0.04
    81      colour    = "1.0, 1.0, 1.0, 1.0"
    82      align     = "left"
    83 
    84      showMultiplier = true
    85     />
     49     caption   = "Lives: "
     50    /> -->
    8651  </OverlayGroup>
    8752</Template>
    88 
    89 
    90 <Template name="spaceshiphud">
    91   <OverlayGroup name = "spaceshiphud" scale = "1, 1">
    92     <HUDHealthBar
    93      name              = "HealthBar1"
    94      background        = "Orxonox/HealthBarBackground"
    95      size              = "0.35, 0.0875"
    96      position          = "0.0 , 0.9 "
    97      pickpoint         = "0, 1"
    98      bartexture        = "healthbar_bar.png"
    99      textfont          = "VeraMono"
    100      textusebarcolour  = true
    101      textscale          = 0.4
    102      textoffset        = "0.325, -0.825"
    103      textpickpoint     = "0, 0"
    104      textalign         = "right"
    105      correctaspect     = true
    106      iconmaterial      = "Orxonox/BarIconHealth"
    107     >
    108       <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
    109       <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
    110       <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
    111     </HUDHealthBar>
    112  </OverlayGroup>
    113 </Template>
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc

    r11529 r11533  
    6363        bEndGame = false;
    6464        lives = 1;
    65         level = 1;
     65        level = 0;
    6666        point = 0;
    6767        bShowLevel = false;
     
    8181            this->tubes.pop();
    8282            levelUp();
     83            point++;
    8384        }
    8485    }
     
    8788    {
    8889        level++;
    89         //toggleShowLevel();
     90        toggleShowLevel();
    9091        //showLevelTimer.setTimer(3.0f, false, createExecutor(createFunctor(&FlappyOrx::toggleShowLevel, this)));
    9192    }
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h

    r11529 r11533  
    9696        private:
    9797            void toggleShowLevel(){bShowLevel = !bShowLevel;}
    98 
     98           
    9999            const static int nAst = 7;
    100100            Circle Asteroids[nAst];
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxHUDinfo.cc

    r11521 r11533  
    4242        this->FlappyOrxGame = nullptr;
    4343        this->bShowLives_ = false;
    44         this->bShowLevel_ = false;
     44        this->bShowLevel_ = true;
    4545        this->bShowPoints_ = false;
    4646        this->bShowMultiplier_ = false;
     
    5151        SUPER(FlappyOrxHUDinfo, XMLPort, xmlelement, mode);
    5252
    53         // XMLPortParam(FlappyOrxHUDinfo, "showlives",     setShowLives,     getShowLives,     xmlelement, mode).defaultValues(false);
    54          XMLPortParam(FlappyOrxHUDinfo, "showPoints",     setShowPoints,     getShowPoints,     xmlelement, mode).defaultValues(false);
    55         // XMLPortParam(FlappyOrxHUDinfo, "showLevel",     setShowLevel,     getShowLevel,     xmlelement, mode).defaultValues(false);
    56         // XMLPortParam(FlappyOrxHUDinfo, "showMultiplier",     setShowMultiplier,     getShowMultiplier,     xmlelement, mode).defaultValues(false);
     53        XMLPortParam(FlappyOrxHUDinfo, "showlives",     setShowLives,     getShowLives,     xmlelement, mode).defaultValues(false);
     54        XMLPortParam(FlappyOrxHUDinfo, "showPoints",     setShowPoints,     getShowPoints,     xmlelement, mode).defaultValues(false);
     55       
     56   
    5757    }
    5858
     
    6363        if (this->FlappyOrxGame)
    6464        {
    65             // if (this->bShowLives_)
     65            // if (this->bShowLives_)  //preperation for easy mode
    6666            // {
    67             //     const std::string& lives = multi_cast<std::string>(this->FlappyOrxGame->getLives());
     67            //     const std::string& lives = multi_cast<std::string>(this->InvaderGame->getLives());
    6868            //     this->setCaption(lives);
    69             // }
    70             // else if(this->bShowLevel_)
    71             // {
    72             //     const std::string& Level = multi_cast<std::string>(this->FlappyOrxGame->getLevel());
    73             //     if (this->FlappyOrxGame->lives <= 0)
    74             //     {
    75             //         setPosition(Vector2(0.1, 0.65));
    76             //         this->setCaption("Game ends in 30 seconds.\nPress (e)xit / (q)uit to go to the main menu.\nTo restart fly out of the screen!");
    77             //         setTextSize(0.05);
    78             //         this->FlappyOrxGame->bEndGame = true;
    79             //     }
    80             //     else if (this->FlappyOrxGame->bShowLevel)
    81             //     {
    82             //         setTextSize(0.1);
    83             //         setPosition(Vector2(0.3, 0.55));
    84             //         std::stringstream sstm;
    85             //         sstm << "Level " << Level;
    86             //         this->setCaption(sstm.str()); // + level
    87             //     }
    88             //     else
    89             //     {
    90             //         setTextSize(0.04);
    91             //         setPosition(Vector2(0.14, 0.055));
    92             //         this->setCaption(Level);
    93             //     }
    9469            // }
    9570            if(this->bShowPoints_)
     
    9974                {
    10075                    setTextSize(0.2);
    101                     setPosition(Vector2(0.1, 0.25));
     76                    setPosition(Vector2(0.1, 0.02));
    10277                    this->setCaption("Final score:\n" + points);
    10378                    this->setColour(ColourValue(1, 0, 0, 1));
     
    10681                {
    10782                    setTextSize(0.04);
    108                     setPosition(Vector2(0.14, 0.1));
     83                    setPosition(Vector2(0.14, 0.02));
    10984                    this->setColour(ColourValue(1, 1, 1, 1));
    11085                    this->setCaption(points);
    11186                }
    11287            }
    113             // else if(this->bShowMultiplier_)
    114             // {
    115             //     int mult = this->FlappyOrxGame->getMultiplier();
    116             //     const std::string& Multiplier = "X " + multi_cast<std::string>(mult);
    117             //     this->setCaption(Multiplier);
    118             //     this->setColour(ColourValue(1, 0, 0, clamp(float(mult * 0.1), 0.0f, 1.0f)));
    119             //     this->setTextSize(clamp(float(mult * 0.1), 0.0f, 1.0f) * 0.01f + 0.04f);
    120             // }
     88           
    12189        }
    12290    }
Note: See TracChangeset for help on using the changeset viewer.