The solution: :)
see my previous post for some code.
the problem was twofold: check somehow, if the ball moves SOO slightly, it is
to be considered dead.
BUT! there also was a major flaw in the way the ball bounced back up: the speed
was assumed to INCREASE all the way, even AFTER the dir
#ok, I think I have it broken down into pieces now... check out this code:
#
import sys, pygame, mathpygame.init()pixelspercm=10.0gravity=9.80 * 10.0 #
meter per second per second (juiced up a little :) )framerate=50.0 # per
secondlossperbounce=0.33 # lose energy per bounceframestosilence=3
ok, I had this problem once, a while ago, simulating bouncing rigid balls. lost
the code...
The best I think you can do, is, in pseudo code:
mainloop:
-get the current time in ms
-calculate the new position of the ball
-take speed of ball, take direction of ball, calculate the imaginary e
#!/usr/bin/env python
import pygame
from pygame.locals import *
#center screen
import os
#os.environ["SDL_VIDEO_CENTERED"] = "1" ## (UN)COMMENT TO SEE EFFECT
# WITH os.environ["SDL_VIDEO_CENTERED"] = "1" :
#when maximized: window does not make it to the top -> half of the taskbars
height??
#w
This example is just to show: yes. you CAN put a pygame display in the
middle of your screen (on windows only, i guess?) and have a transparancy
key in your icon bitmap. Something that bothered me for a long time :)
yes, I know wx is no good. If any one knows a better way, please share!
(I use