Hi @clns53
Nice work on these exercises!
Here are some comments:
- Task1: Instead of the button text I would rather test with the class name (
if (btn.className === 'on') { /*...*/ }
) and also change it. The reason is that texts tend to change over time in real projects. - Task 2: It should be possible to freely move the circle around on the field. For that you should just increase/decrease the
x
ory
value instead of setting absolute numbers. For example whend
is pressed you could do:x += 2
. - Task 3: Nothing to complain from my side. Well done
I hope that helps.
Michael
1 Like
Thank you. Though I noted that using a larger value like x += 20 eventually pulls the circle away and using smaller value like x += 2, the movement can barely be noted
1 Like
Yeah, the value to increase the variable is a matter of taste I would say. With smaller values you can hold down the keyboard button to do consecutive moves which would then look more “natural” rather then jumping from one position to the other.
certainly. Thank you
1 Like