Click here to Skip to main content
15,560,542 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
So I’m making a bowling game and I’ve made the controls to throw the ball and because it’s a mobile game I want to know how to “curve” the ball with the flick of a finger, which then gains friction on parts of the lane, like in real life. Is there any way to do this?

What I have tried:

Well I’ve learnt the C# basics but I can’t wrap my head around this specific task, so I thought the internet people would be my best chance at help
Posted
Updated 26-Mar-21 1:28am
Comments
Richard MacCutchan 26-Mar-21 7:29am    
It rather depends on how the ball is moved in your program. Presumably you have some loop that draws it at successive points along an axis. So if you receive a signal while drawing you need to alter the x or y values to change the direction.
Greg Utas 26-Mar-21 7:53am    
Further to Richard's comment, the "signal" that you receive will be a finger swipe, however that event is communicated in the framework you're using. Similar to a mouse drag. I don't write this kind of software, but it could be that you get "finger down" and "finger up" events and have to turn those into a "swipe" of whatever magnitude by also looking at where they occurred on the display.
Gerry Schmitz 26-Mar-21 14:59pm    
Bowling ball physics.

https://www.real-world-physics-problems.com/physics-of-bowling.html

1 solution

Hello Michael,
It seems that the effect of friction increases as the forward velocity drops and the sliding over the surface decreases. Therefore maybe the finger swipe gesture on the device can use both the initial forward speed and a side movement at the end of the gesture.

bowling ball physics

So the input gesture can provide two variables; forward velocity and side spin.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900