I am creating a game where a small bottle is hit by a ball. I would like to have the game cause the bottle to fall to the left if the ball hits the bottle on the right-hand side.
Likewise, I would like to have the game cause the Bottle to fall to the right if the ball hits the bottle on the left-hand side.
I cannot seem to figure out how to do this. Basically, the bottle is a single object. The best I could do is is cause a physics force when the bottle is hit. I likewise can have the game create a random physics force when the ball hits the bottle. I accomplish this by having construct look for the following event:
Ball is overlapping bottle <-- but I cannot figure out how to have the computer determine if the ball is overlapping the left side of the bottle or the right side of the bottle. Again, the bottle is a single object.
However, I cannot figure out how to instruct the game to apply a different physics force depending on whether the bottle was hit either on the left side or the right side.
Anybody have any simple ideas how to do this? Thank you in advance.