To be able to reset the game, we’ll add a button in the world that allows players to restart by stepping on it. Later, you could change your code to always reset on a timer, or use a particular key on your keyboard, but this will give us the ability to reset and repeat the game as much as we want.
You can pick anything to be your button, but for this code to work, it needs to have two animation frames.
- Remix this: https://dotbigbang.com/voxelobjectviewer/89f982853b6e439db155499cbc41402a/Button%20Unpressed%2FPressed%20(remixed%20from%20dmm)
- Or create your own button with two animation frames (unpressed first, then pressed)
Once you have a button, drag it into your world.