Moving characters | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Moving characters

So, I have created a code to move a character. However is their anyway to improve this. I also want to allow it to react when it touches another object e.g a square on the screen. I have looked it up but it hasn't come up with want I wanted. Could anyone help? Thanks in advance! Code: https://code.sololearn.com/W2z8nh41xi88/#html

1st Jan 2018, 10:12 PM
Zakariya
Zakariya - avatar
1 Answer
0
well you have created some HTML but you need to write JavaScript for it and using conditional statement by comparing the positions you can change the attributes of ur object to move in other directions.
2nd Jan 2018, 4:44 AM
Shaheryar Malik
Shaheryar Malik - avatar