Michael Edwards wrote:
It's funny that if you just wait, the ball starts rolling away. I should probably provide a way to stop the simulation, but doing the simulation step in begin_round is not conducive to that. Eventually there will be a separate step method. For now you could just deactivate the ball until the person throws it.Cool, no sweat! The bowling app is here: http://workingweek.org/apps/bowling-0.1.tar.gzIt makes pretty good use of the ode extensions, though I'd like to add more complexity to the physics. It requires the latest Soya from CVS (to get the linear velocity to work). To play: * By default, the game is for two players. You can specify more or less on the command line, like so: python bowling.py 3 * To aim the ball, hold down the left mouse button * To throw, release the left mouse button * After your ball has hit all the pins you think it's going to hit, press "Enter" to continue. You could just delete them from the simulation, which I think world.remove(pin) would do. Come to think of it, it probably won't work right. I need to override the remove method in ode.World.Notes: * Scoring is VERY generous. Just tapping a pin will mark it as hit (TODO: make this tougher) * The game logic isn't finished yet, so there is no end to the game. (TODO: add 10th-frame logic) * The struck pins get moved behind the "player". Don't be surprised if you see them in the background. (TODO: find a better place to stash these, probably behind some scenery) The pins could be fatter. Also, the center of mass and intertia tensor for them aren't quite right. You can adjust the center of mass without adjusting your model by making a subvolume to contain the shape as a child of the actual body of the pins.* I'm really looking for ideas to make the game look and play better, so all suggestions welcome. The friction model in ODE is somewhat simplistic, so it may be hard to get good results. For one thing, the ball will probably tend to suddenly "catch" as soon as the speed slows down enough to get below the static friction.* Any tips on using FRICTION would be appreciated. I played around with mu and slip, but I didn't get good results. Eventually, I'd like the ball to be able to hook, which would require that the ball spin fast enough at first to overcome static friction, then slow down enough to catch the floor and start hooking. Not sure how to make this work. It's great!* The code is an undocumented mess. Sorry! * The scale is wacked out. The units are about 4 times as large as they ought to be, assuming 1 unit ought to equal 1 meter, hence my fudging the gravity. 4 units = 1 meter. * Does anyone have any idea how to use the widgets? Right now, I'm just using text labels, but I'd like to use Banner objects if I can get them to work. Hope it's fun and educational! Couple bits of advice:
|
signature.asc
Description: OpenPGP digital signature
