Creating a score card (without using leaderboards)

By LadylexUK

I used this in my FPS game Wonderland Attacks. At the end of every room battle I put up a scorecard showing number of kills and bonus score from the level timer. I placed this code in the door opening brain.

In enemy brains you increment a global variable at death. This gives you the number of kills. To get a score that is unique to each round call the variable something unique.

WHEN [started to][is dead] DO [global][numvar:enemy][incremented by][1]

Because I have made this a player object by adding the A control, you should put this code on page 2 and have [call page][2]on page 1 to stop enemies from attacking it.

  1. WHEN  DO // whatever triggers your score card. In my game it was death of bosses and minions
  2. …WHEN DO [boolvar: display score][equals][true]
  3. …WHEN [started to] DO [IWP:timer][boolvar:timer on][equals][false]
  4. …/…WHEN DO [numvar:kill score][equals][(][global][numvar:enemy][multiplied by][10][)] // in the enemy brain they incremented a global enemy variable at death
  5. …/…WHEN DO [numvar:bonus score][equals][floor][(][global][numvar:enemy][multiplied by][(][IWP: timer][numvar:bonus time][divided by][10][)][)]
  6. …/…WHEN DO [numvar:total round score][equals][numvar:bonus score][plus][kill score]
  7. …/…WHEN DO [global][numvar:total score][equals][global][numvar:total score][plus][numvar:total round score]
  8. WHEN [boolvar:display score]
  9. …WHEN [once] DO [world pace][equals][0]
  10. …WHEN [until][A][pressed] DO [display][text: KILL SCORE: ][plus][numvar:kill score][screen center]
  11. …/…WHEN DO [display][text: BONUS SCORE][plus][numvar:bonus score][screen center]
  12. …/…WHEN DO [display][text: ROUND SCORE: ][plus][nuvar:total round score][screen center]
  13. …/…WHEN DO [display][text: TOTAL SCORE: ][plus][global][numvar:total score][screen center]
  14. …/…WHEN DO [display][icon:A][screen bottom center]
  15. WHEN [A][pressed]
  16. …WHEN DO [world pace][equals][1]
  17. …WHEN DO [boolvar:display score][equals][false]

Comments are closed.

Powered by WordPress.com.

Up ↑

%d bloggers like this: