30th Jul 2022, 9:22 AM
18TheCoder
18TheCoder - avatar
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
30th Jul 2022, 10:06 AM
PanicS
PanicS - avatar
+ 1
18TheCoder You cannot have multiple html, head, body tag in a single document.
31st Jul 2022, 5:54 AM
AÍąJ
AÍąJ - avatar