• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Simple Collision Detection

Kadafi

Newbie
Hi, i am making a game where I have 2 bitmaps as objects, i want to check if object 1 and object 2 collide

e.g.

obj1 (moves around on screen)




obj2 (at bottom always)

when obj1 touch the top of obj2, i want to move obj1 back up.

could anyway please help me with this. I have looked online and found many examples but they are too complicated, and I am just a new developer, and just want a simple collision detection and nothing too fancy.

thanks
 
For a simple collision check you can use the "bounding box collision algorithm".

You can find a lot of samples and code on the net to explain this.
A simple procedure (and explanation) can be found, for example, at :

Collision Detection
 
Back
Top Bottom