Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

I did something a little different: I increment a variable for the use of meta-verbs, and subtract it from turns() when I display the score.

integers { faketurn : integer "0"; }

   : match "inventory _"  { : increment "faketurn"; : inventory; : done; }
   : match "save _"  { : increment "faketurn"; : save; : done; }
   : match "load _"  { : increment "faketurn"; : load; : done; }

  : match "score _"  {
      : increment "faketurn" ;
      
      : if ((turns()-faketurn) == 1) {
         : print {( "Your score is " + score + " out of a possible 10 in " + (turns()-faketurn) + " turn." )}
      }
      : else {
         : print {( "Your score is " + score + " out of a possible 10 in " + (turns()-faketurn) + " turns." )}         
      }
      : done;    }