Page 1 of 1
[solved] Help with my pool(billiards) game
Posted: Fri May 24, 2024 7:59 pm
by betobala
I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help?
Re: Help with my pool(billiards) game
Posted: Fri May 24, 2024 8:07 pm
by darkfrei
betobala wrote: ↑Fri May 24, 2024 7:59 pm
I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help?
Make .love not .rar
Re: Help with my pool(billiards) game
Posted: Fri May 24, 2024 9:26 pm
by betobala
darkfrei wrote: ↑Fri May 24, 2024 8:07 pm
betobala wrote: ↑Fri May 24, 2024 7:59 pm
I need to draw the pool cue behind the cue ball, pointing at the mouse position. But I do not know the math to make that happens, can I get some help?
Make .love not .rar
sorry about that, its my first time making a game.
Re: Help with my pool(billiards) game
Posted: Fri May 24, 2024 10:43 pm
by dusoft
darkfrei wrote: ↑Fri May 24, 2024 8:07 pm
Make .love not .rar
Ha!
Re: Help with my pool(billiards) game
Posted: Sat May 25, 2024 10:26 am
by RNavega
Get the angle between the mouse cursor and the ball with math.atan(mouseY - ballY, mouseX - ballX). The pool cue is 180 degrees (1 pi radians) in the other direction.
- temp.png (51.67 KiB) Viewed 2164 times