+ 1

What's wrong with this? I've been beating my brains out trying to finish my first game.

Hello, those taking Game Development. Help me find error in this code. https://code.sololearn.com/Wb7EEXNLrrnE/?ref=app

29th Jan 2022, 1:21 PM
Zar Hlyan Aung
Zar Hlyan Aung - avatar
5 Respuestas
+ 1
Kevin my apologies, I did a hotfix and got it to run. I placed the variables 'x' and 'y' outside of the function 'draw' and gave the variable 't' an initial time. The green cube should now move for you and then reset upon reaching the end of its path. https://code.sololearn.com/WRAG4qtTtwEI/?ref=app
30th Jan 2022, 6:59 PM
Sam
+ 1
Fixed it. I put your HTML script into the JS file inside the 'window.onload' call, placed some missing semicolons at the ends of a few lines, and moved your variables 'x', ',y', and 'speed' into the 'draw' function. https://code.sololearn.com/WRAG4qtTtwEI/?ref=app
29th Jan 2022, 3:38 PM
Sam
+ 1
Kevin may I have your permission to make my copy of your project public so that I can share your work with my network?
30th Jan 2022, 7:01 PM
Sam
0
Hello , Sammy. I appreciate your help. But when I tried it, it still doesn't moving. What's wrong with it. Does it work on your device?
30th Jan 2022, 1:33 PM
Zar Hlyan Aung
Zar Hlyan Aung - avatar
0
Oh, Sammy! Of course, you can use it. What I want to say is Thank you So much for your help.
31st Jan 2022, 12:27 PM
Zar Hlyan Aung
Zar Hlyan Aung - avatar