Log In  

Cart #age_check-1 | 2021-12-08 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
4

This is a small snippet of code that asks the player for their birth date, checks if they're over 18 years old, and either passes or blocks them from playing whatver game is implemented in the cartridge.

If the player already passed the check once, it's saved in the cartdata, so they don't have to do it every time.

To implement this in your game:

  • copy the entire contents of tab 1 into your game code somewhere
  • add 🐱ok=false at the start of your game code
  • add the 🐱init() call in the beginning of your game, but after the cartdata() call. If your game doesn't use cartdata, you may skip this step, but the game will ask for the player's birth date every time it's launched.
  • add if (not 🐱ok) then return 🐱draw() end as the first line in your draw routine
  • add if (not 🐱ok) then return 🐱update() end as the first line in your update routine
P#102023 2021-12-08 10:35


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-18 23:38:26 | 0.009s | Q:14