+ 1
Animation help with game development with js
Why doesn't the square move? https://code.sololearn.com/WeJNaEGyv979/?ref=app
10 Answers
+ 2
I've made the changes to it and it works.
+ 1
Tysm! Moshe Schnitzler and AnonyMouse , what do you mean no reference? I made a canvas, gave it an id, used the id in the js section with the function and used setInterval to call it.
+ 1
Jalaj Madaan it looks nice, well done!
+ 1
Jalaj Madaan Youâre welcome
Happy coding!
0
The x and y variables should be declared outside the draw function. Everytime you call the function you redeclare x and y so its not being incremented
0
I don't see any reference to the javascript anywhere in the html or css, the function draw never seems to be called
0
Also, before you start drawing, clear the previous frame with
context.clearRect(0, 0, 600, 400)
0
Tysm for the help! I was confused with it, that helped me in another way to animate with js too!
0
I can't find this course. Is It still available?