Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Adding BonusLives...

  1. #11

    Adding BonusLives...

    Maybe something like this (not tested):

    Code:
    var
      LastBonusScore : integer; //Set to zero when starting a new game
    
    procedure TFormGame.BonusLife;
    begin
      if (Points >= LastBonusScore+25000) then
      begin
        Inc(Lives,2);
        Inc(LastBonusScore,25000);
      end;
    end;
    It should give you a bonus every 25000 points.
    ZGameEditor - Develop 64kb games for Windows.
    Thrust for Vectrex - ROM-file and 6809 source code.

  2. #12

    Adding BonusLives...

    Yep, this should work, too And you don't need the boolean variable... this is the better solution.
    <a href="http://www.greatgamesexperiment.com/game/Valgard/?utm_source=gge&amp;utm_medium=badge_game"><img border="0" alt="GGE" title="GGE" src="http://static.greatgamesexperiment.com/badge/game/valgard/gge400x56.png"></a>

  3. #13

    Adding BonusLives...

    That solution is something like how I did my extra lives. (Edit: on re-reading this, it's pretty much exactly what Villek wrote )

    I have a variables:
    Code:
    fScore &#58; integer;
    fLives &#58; integer;
    fNextLifeAt &#58; integer;
    At the start of a new game
    I initialise them
    Code:
    fScore &#58;= 0;
    fLives &#58;= 3;
    fNextLifeAt &#58;= 25000;
    then in my game loop (or timer event),
    I'd check
    Code:
    If fScore >= fNextLifeAt then
    begin
        inc&#40;fLives&#41;;
        inc&#40;fNextLifeAt, 25000&#41;;
    end;
    Of course this isn't exactly how I do it, My extra lives are spawned and need collecting before they take effect and my system is Object Oriented, but the theory is the same.

  4. #14

    Adding BonusLives...

    You guys realy know your stuff

    Thanks to everyone. VilleK, your solution works and seems to be the best :idea:
    Wake up from the dream and live your life to the full

  5. #15

    Adding BonusLives...

    edit: *oops, delete this*

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •