i have few images, moving inside a frame, i want to check collision between those images.
i tried it, i just prints the x and y coordinates of my images, but than what do i do i don't know.
do i need to do something like:-
create rectangles outside the images and check collision in between those rectangles, or something else??
the second link is a bit long, but scattered throughout is some worthwhile reading relevant to your question
Joined: Aug 20, 2011
thank you michael for replying.
thanks for the links, but i am not getting solution of my problem.
can you please please tell me what basic steps i need to follow, to check the collision.
Joined: Jun 09, 2003
> can you please please tell me what basic steps i need to follow, to check the collision.
the code in those links is almost identical to your problem - it's all to do with setLocation(),
and checking whether the new location collides/overlaps.
in the first link, my second last post is an example of dragging/checking overlap.
modify the code from:
1) dragging to animation setting-the-location
2) taking into consideration each label's size, instead of the 25x25 of the panels
and that would be one of the ways to solve your problem of rectangles (labels with images).
if you want the actual fish shapes colliding, then that's a whole lot more complex.