• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM add and remove physical object collision check?

B

Bhreno

Guest
are two objects physics:
obj_ball
obj_wall

They may collide with each other, but if obj_ball is in the same direction as obj_wall, obj_ball may cross through it. Otherwise they will collide and obj_ball will deflect.

in picture:
blue arrow > if obj_ball is in this direction, it will be able to cross obj_wall. (both point to the same side).
red arrow > if obj_ball is opposite the direction pointed by obj_wall, they will collide and obj_ball will divert its course.

How to make this collision happen physically?
 

Attachments

C

Catastrophe

Guest
I'd say if any time you are on a blue arrow and not on the wall, mark a flag as true. If the flag is true, only make it false when you collide with neither the wall or the arrows in step (so if you leave the arrow and are still inside a wall, the flag would not be unset). While it's true, you ignore bouncing. If it's false and you collide with a wall, bounce.

Unless you mean calculating a bounce's direction. Also assuming those arrows are separate object next to the wall.
 
Top