Why not working properly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why not working properly?

https://code.sololearn.com/W81RrJSxbtga/?ref=app When the weapon is touching the virus, the alert box is not showing up!

14th Aug 2018, 6:20 PM
B.D
B.D - avatar
3 Answers
+ 1
i THINK at the first look, posX and posXi, posY and posYi, are the centers of both objects, and it will work only if centers overlap, which is not necessary for objects to touch
14th Aug 2018, 6:26 PM
Aleksandar Stevanovic
Aleksandar Stevanovic - avatar
+ 1
there must be an easier way than mine, I think position can be array of all points of that object, in your case you'll have two arrays. game is over if these two arrays have the same member... but again... there must be a better and easier way
19th Aug 2018, 8:29 AM
Aleksandar Stevanovic
Aleksandar Stevanovic - avatar
0
then how to show the alert box when objects touch?
17th Aug 2018, 12:02 PM
B.D
B.D - avatar