+ 1
Box Game
So why is it not adding a point for whenever you touch a box? https://www.sololearn.com/compiler-playground/WyXqIAu1sBa1/
7 Respuestas
+ 2
The box…random… variables are local and cannot be see in another parts or functions in your code. A solution shows following changed code:
https://code.sololearn.com/WJdTq9l1NlQ2/?ref=app
+ 3
Any feedback from you Your Mom ?
+ 2
Chris Coder Thank you for the information. It works for me either way. Now I have modified it. Should work everywhere.
+ 1
JaScript do u know why they arent moving whenever u clikc them
+ 1
JaScript It works in a web browser but it is not working via codeplayground.
+ 1
@JaScript so u see line 119, and it says
box1.style.position = "relative";
box1.style.top = box1RandomHeight;
box1.style.left = box1RandomWidth;
i want it so everytime u click a box it randomizes its position. like how whenever u click New Game it randomizes the boxs position. u get what i mean?
0
Your Mom I have already answered your question above and in my corrected code they move.
If the answer is not sufficient then it is needed from you a precise question and description, what do you want to achieve, how and when should something move?