Can you modify my code so it detects collision or when it touches object it shows game over? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you modify my code so it detects collision or when it touches object it shows game over?

Please help me guys. https://code.sololearn.com/WZx4G1kDYSUc/?ref=app

10th Jun 2020, 10:33 AM
Learn Big - LB
Learn Big - LB - avatar
3 Answers
+ 1
This is what I was talking about https://code.sololearn.com/W5eWW0wVNcM8/?ref=app
10th Jun 2020, 11:29 AM
Abhay
Abhay - avatar
+ 2
I think it would take a lot of time for anyone to go through your code and modify it unless you explain what each component is doing ,but I would just say use left property of both elements you want to detect collision If the block jumping left position property matches the left property for square shooting towards it here you have collision
10th Jun 2020, 10:50 AM
Abhay
Abhay - avatar
0
More explanation needs I think I will wait for more ans
10th Jun 2020, 10:53 AM
Learn Big - LB
Learn Big - LB - avatar