Skip to content
Advertisement

How do I keep only the first map and when the game is finished, if you click on the map the game restarts

I havet this codepen: https://codepen.io/sp2012/pen/VwpyWdp . Unfortunately, this code is too advanced for me. The game has three maps. I want to keep only the first map and when the game is finished, if you click on the map the game restarts.

The code follows:

This is the HTML:

JavaScript

This is the CSS:

JavaScript

Here is the JavaScript:

JavaScript

Any ideas please?

Advertisement

Answer

Just comment out the second and third level section of the levels[0] object (maps). Change the HTML content that makes reference to other levels.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement