This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

nccb
nccb presents ...

2012/9/5

Pool

Left-click to shoot the cue ball in that direction.

This scenario implements the ball and wall collisions reasonably well, to provide a basis for a pool game (at the moment, it's a bit of a toy). All the maths is explained in this post:

http://sinepost.wordpress.com/2012/09/05/making-your-balls-bounce/

Feel free to take the code and make a finished game with it.

6467 views / 1138 in the last 7 days

1 vote | 0 in the last 7 days

Tags: with-source

open in greenfoot
Your browser does not support the canvas tag.
imacatimacat

2012/9/7

That is so cool~!
PointifixPointifix

2014/3/24

is this the tutorial you got the collision results from? http://sinepost.wordpress.com/2012/09/05/making-your-balls-bounce/ cause mine does not work as fine as yours
PointifixPointifix

2014/3/24

i have a question to this :) to prevent the balls from sticking together you got the while loop with boolean altered right? i had to speed up the cueball to get this while loop infinite, so greenfoot stands still then, but thats very hard in your game, i did the same with the altered loop at my game, but my greenfoot stops much more often, any tips or solution i can get from you? ;) would be nice
PointifixPointifix

2014/3/24

oh lol the comment on the top is senseless sry i didnt read discription ;D
PointifixPointifix

2014/3/25

lol the tutorial is from you ;) thats why ;DD nice done

Want to leave a comment? You must first log in.

Who likes this?

imacat