Here is the thing a round object is falling. You can click anywhere and a star appears. If the star touches the objects it is projected up on the y axis.
I would like the object to be projected depending of the angle between the star and the center of that said object. Because when the object collides with the star it's always projected perfect on the y axis.
Do you have any formula?
angle(object.X, object.Y, star.X, star.Y)+180[/code:moshmvuo]
Should give you the opposite angle of collision with another object. Put that on a "on collision" event
It won't take into account the shape of the objects, so it should be used to simply move the "object" in the opposite direction of the "star"
Develop games in your browser. Powerful, performant & highly capable.
Thanks. The formula seems strange but i will try it asap.