0 votes
by (150 points)

I want to make a game where each time it is played, a screen with "You have been hacked. Game over. Start again!" comes up at random points during the game.


Is this something that is possible in Sugarcube? Or is there an alternative similar to this?


Thank you in advance!

1 Answer

+1 vote
by (23.6k points)

You should be able to accomplish this without any problem. Depending on how you want this to work you can for example put something like this into a passage named PassageReady:

<<set $hacked to random(100)>>
<<if $hacked == 1>>
   <<goto "GameOver">>

Now whenever the player enters a new passage, this code is exectuted giving them a random 1% chance to be send to the "GameOver" passage.

by (150 points)
Thank you for your help, that was much simpler than I thought!