Simple Collision Detection


  1. Kadafi

    Kadafi Member

    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

    Advertisement
    :
  2. powerpoint45

    powerpoint45 Well-Known Member

    You will need to make your own if statements,such as
    if (left>otherballleft){
    Die
    }

    Just tweek it till u got it
    Kadafi likes this.
  3. aciampal

    aciampal Member

    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
    Kadafi likes this.
Loading...

Share This Page