After quite annoyingly wasting an hour playing a miniclip pool game this afternoon it ocurred to me it ‘may’ be relatively easy to write a simplified version of one using Pulpcore.
I put this together in about 2 hours using Pulpcores bubblemark code (ok, I nicked a pool table/cue from the net, so will replace the stolen graphics if I continue with this). Doesn’t do anything yet!
http://www.bullsquared.com/pool/pool.jsp (Pulpcore applet)
Source code for those not familiar with Pulpcore/Bubblemark tests here:
http://www.interactivepulp.com/pulpcore/bubblemark/
http://www.interactivepulp.com/pulpcore/bubblemark/src/Ball.java
Question, is: I know nothing about ball physics/java physics libraries etc… (Can’t say I even understand the Ball.java elastic collision code either)… Anyone know if it would be easy to change this (the vx/vy velocities) to put in some ball momentum code so the balls actually stop (easy noob examples please?)… Or would it be better to use a physics engine and if so, which one? I guess for cueball top/back spin and side would have to do this myself regardless (or do any of the physics libraries handle this too)?
Not sure whether I’ll continue with this one (depending on complexity of physics) or add the ever growing uncompleted work shelf!