Does anybody know how i can make a billiards engine in TGF? The balls have to go in the right direction and riccochet off eachother realisticly like in real pool.
I also wouldn't mind knowing how i can make it so the player can choose how much power they use: [Like pulling the cue back with the mouse, and the computer knowing how much power the player is using and at what angle they are hitting the ball.]
get the Advanced Math Object. and then read some articles about 360 degrees movments, because using ballmovment for the balls doesnt work at all. to make the ball bounce of each other, make the ball's look away from each other when they collide. for the power you just add to a counter when the mouse is hold, then when you release, set the white balls speed to the counter. pulling the cue back would be
always
---> set cue x to x of white ball + cos (angle between mouse and white ball) * speed counter
---> set cue y to y of white ball + sin (angle between mouse and white ball) * speed counter
then it would be pulled away, when you add to the speed counter.
but i dont think it would be worth the trouble, you will need least 4 alterble values (one for x, one for y, one for angle, and one for speed) and TGF only have 3
I'd imagine it comes from Snooker and Billiards which originated in England. Snooker relies on accuracy of shot and cueball placement meaning 99% of the time spin is used on the cueball. I guess the Americans decided to call 'spin' 'English' after its prominent use in English cue-games. Probably.