Re: [pygame] Why does my ball vibrate?

2007-11-29 Thread Douglas Bagnall
Greg Ewing wrote: > Matt Smith wrote: >> I can't quite get my head around WHY the ball sinks into the ground if >> I don't set ypos back to 384 but it certainly works. > > It's probably because you're applying gravity to the ball > even when it's touching the ground. So it repeatdly gets > accele

Re: [pygame] Why does my ball vibrate?

2007-11-29 Thread Greg Ewing
Matt Smith wrote: I can't quite get my head around WHY the ball sinks into the ground if I don't set ypos back to 384 but it certainly works. It's probably because you're applying gravity to the ball even when it's touching the ground. So it repeatdly gets accelerated downwards for one time ste

[pygame] Multiple windows in pygame

2007-11-29 Thread Michael Sparks
Hi, I just thought some people may find the following blog post of interest - since it details how to allow multiple windows in pygame with relatively minimal fuss. http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&nodeid=1196129474 (It's a demo that creates 8 top level windows, each co

Re: [pygame] Why does my ball vibrate?

2007-11-29 Thread Ian Mallett
For your amusement (and envy), here's some beautiful simulations. On their bouncing ball: the ball is rendered in 3D and actually deforms noticeably and oscillates after bouncing. I think it was here: http://www.gamedev.net/community/forums/topic.asp?topic_id=465499 You'll have to go to the proje

Re: [pygame] Why does my ball vibrate?

2007-11-29 Thread Ian Mallett
I actually got interested in the problem, and tried to recreate your code, even though you practically gave it to me. Had to sleep though :) I'll finish when I get home. Anyway, as long as the physics time engine is based on your fps, any point when the window is moved will cause a drop in the fp

Re: [pygame] Why does my ball vibrate?

2007-11-29 Thread Matt Smith
Thanks for all the help. I have modified the code for determining the position of the ball so that the pixel co-ordinates are always integers: ypos = ypos + int(((velocity + newvelocity) / 2) * time_passed * 160) This has cured the vibrating problem and the ball comes to rest quite reali

Re: [pygame] Joystick missing events?

2007-11-29 Thread Ian Mallett
On 11/28/07, Joe Johnston <[EMAIL PROTECTED]> wrote: > Thanks Ian for the initial response. I agree with Ethan that the import > statement isn't likely to be the cause of the problem. That simply > imports symbols into the current namespace. OK. I thought it might not work, but then, it was a gu

Re: [pygame] A bunch of newbie questions

2007-11-29 Thread Mundial 82
Hi there, Thanks a bunch - it works (and sorry for my poor explanatory powers :) cheers! Naranjito On Nov 28, 2007, at 8:55 PM, Michael George wrote: I'm not sure exactly what you want, but for x in object: deadStar.grav(x) will call deadStar.grav on each sprite in the sprite group "obje