+1 vote

Hello,

I am trying to make my first game ever. The basic idea is there is a ball with initial direction and speed, going up at some angle, not falling, and it bounces off the edges of the screen. The player tilts their phone and the ball's bounce direction depends on the incline of the phone. I managed to get the data from the accelerometer and transform it to angles, although it is undefined for some angles, but I can't figure out how to change the ball's movement direction according to the incline. I want the ball to keep it's direction regardless of the incline, like in the picture, and then "bounce" off the screen edge at an angle. I think I need to change the movement vector when the phone incline changes but I am not sure how to do it. Any ideas would be appreciated! Thanks

enter image description here

in Engine by (15 points)

I don't think your picture embedded properly.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.