[SOLVED] Calculate the degrees?

TF101

  • *
  • Posts: 84
Good morning to all,

I need a food for thought, please

I'm currently testing an accelerometer game.
I want the "ball" to hit an object and be pushed back in the opposite direction.
At the moment of the collision, I only have the data x-speed and y-speed of the ball available.

Is it possible to calculate the number of degrees from the two variables and to convert them in the opposite direction?

I hope I have not expressed myself too stupidly now.
I have inserted a small picture.

greetings
Thomas

« Last Edit: June 07, 2020, 04:53:19 am by TF101 »

LIBERADO

  • *
  • Posts: 2720
You can use the wonderful, excellent, magnificent and impressive EasyMath extension:
http://community.stencyl.com/index.php/topic,27769.0.html

I use it a lot.
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

TF101

  • *
  • Posts: 84
Hi,
Many thanks for your response.
I looked at the wonderful, excellent, magnificent and impressive extension.
I think that will solve my problem. The ball bounces violently but not quite as i want it to.
But I'm sure that I can do it with some work.

Kind regards,
Thomas