Topic: PyGame noob animation problem
When I run the code I only see a black backround nothing more no ball, no animation.
Can someone please help me?
bif="bb.jpg" #black background#
mif="b.png" #ball#
import pygame, sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((640,360),0,32)
background=pygame.image.load(bif).convert()
ball=pygame.image.load(mif).convert_alpha()
x=0
clock=pygame.time.Clock()
speed=250
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
screen.blit(background, (0,0))
screen.blit(ball, (x, 160))
milli=clock.tick()
seconds=milli/1000.0
dm=seconds*speed
x+=dm
if x>640:
x=0
pygame.display.update()Last edited by TheNoob9 (February 9, 2012 14:22)