- 4
How do you start the game??
2 Answers
+ 1
Your code currently only show loading, when we click at button.
You can set 1 function what run game on click, inside this function you need to place loading and game logic.
If your game is small, your loading will show for milisecond(hard to see), you can add some fake loading, to show loading message (or loader icon) for few second and than remove it, using setInterval() - this is fake loader
For true loader you need to make sure game code is loaded(elements and variables are created, additional event listener, style...) before you remove loader and show game to screen(append game elements to screen, so user can see), you can use async await for this.
Also if game is very small, loading will be done very fast and user may not even see loading message
And you probably copy/paste html code here, so you have multiply html,head and body tags
+ 1
18TheCoder
You cannot have multiple html, head, body tag in a single document.