Hey guys, this is kind of a complex question cause i dont speak ensligh very well, and its hard to explain.
So im still doing this app with the guy holding a lantern and killing little ghosts when they get into the path of the light, at one point i had to do the collision detector between the lantern and the ghosts, i had no idea on how to do this, since the lantern is part of the guy.png (it doesnt have it own reference points, dependes on guy.x,guy.y)
What i made was create 2 circles in the extremes of the lantern, and use a function that determines if the ghosts x and y are inside the triangle formed by the circles coords and the guy coords, this was ok to do, but the problem now is that the guy rotates around, so i wasnt sure how to make the circles follow the guy rotation, then i had the idea to include physics and use a weld joint between the 3 objects, this worked almost perfectly, but the problem and the reason of this post is that since i included the physics, when i move around my guy with my mouse(holding touch on android) the guy sometimes randomly spasms around, moving the lanter in all directions, for about half a second, it happens very often, i removed the alpha on the little circles to check what was happening, and it appears like they teleport around the screen during that spasm, im not sure why, if its some sort of collision, or because of moving fast (its not that fast) or the weld joint, i dont know, but its really bothering me and making it almost unplayable.
I read you could make the guy and the 2 dots part of the same “object” will i be able to use the dots x and y and the guy x and y to make the triangle even if they’re into the same object? if so, how can i make an object like that? I know it seems really confusing. I hope any of u could understand what im trying to explain (Rob please!)
I could supply you the full code (around 300 lines) in a zip or something, or the .apk for you to try and see what im trying to describe, i have no idea on how to fix this.
That’s the guy x and y and the two little circles, however the guy object is the whole thing, from the body to the end of the lantern.
Edit: excuse my english, if you dont understand i will try to explain myself better, even if i find it really hard since i dont know how to explain this lol.
Edit: added a youtube video just to show you the spasms, this is how concerned i am about this thing.
http://www.youtube.com/watch?v=ZnpciloSSjQ
Spasms happens at 00:07 and 00:19, and probably at the start.
Edit: added new video with drawmode set to hybrid, hope this helps to know what’s going on. (thanks Burhan).
http://www.youtube.com/watch?v=DBi8L7PmlOw
Spasms happens everywhere, even i died because of one, thats gamebreaking.