0

need help with proper loading background in js game

https://code.sololearn.com/Wu2kG84K6N3J it's either showing the game parts or the background, i need to find out how to display both at the same time.

4th Jun 2022, 2:44 PM
jimmy tornqvist
jimmy tornqvist - avatar
4 Antworten
+ 2
put your context.drawImage(bg,0,0,600,400); inside the draw function
4th Jun 2022, 4:09 PM
Bob_Li
Bob_Li - avatar
+ 2
Thx worked fine=)
4th Jun 2022, 4:22 PM
jimmy tornqvist
jimmy tornqvist - avatar
+ 1
Yes exactly, that was a big problem for me, im on it thx.
13th Jun 2022, 7:50 AM
jimmy tornqvist
jimmy tornqvist - avatar
0
jimmy tornqvist One suggestion: to prevent the text from being selected when pressing the buttons, you can add a user-select:none; to your #buttonsWin css class. Also perhaps cursor:pointer;as an indicator that the buttons are clickable. #buttonsWin{ ... user-select:none; cursor:pointer; }
12th Jun 2022, 10:18 PM
Bob_Li
Bob_Li - avatar