How display path ball will bounce?
Posted
by
boolean
on Game Development
See other posts from Game Development
or by boolean
Published on 2012-12-06T00:16:07Z
Indexed on
2012/12/06
5:22 UTC
Read the original article
Hit count: 326
path-finding
I'm trying to figure out a way to show the path a ball will travel, so that the player can line up a shot before they fire the ball.
I can't think of a way to calculate this path in advance and show it to the player, especially if it involves collision detection. At first I thought I would run the game at a super high speed for one update, plot the path with some dotted lines where the ball bounced, and then in the next frame hide the 'tracer' ball. This seems to have two issues - Calculating collision detection without actually updating the frames and collision detection getting less reliable at high speeds.
If they were straight lines I think I could figure this out in a while loop, but trying to take into account the speed of the ball, the curve of the path, the reflecting from other objects..it all seems a bit much.
I'm not looking for any code and this isn't a platform specific question, more just help trying to figure out conceptually how this would work. Can this be done? Are there techniques to achieve this?
© Game Development or respective owner