| | |
Windows freeze in pygame- Windows
![]() |
hmm well i've little experience with pygame myself but are you sure your not missing something in your code?
i think you need to type stuff like pygame.init() and you have to flip the display stuff like that, like i said i'm not too sure but if you go on the pygame website http://www.pygame.org they might have something in the documentaion or go on their irc channel
a snippet of your code might be good?
then someone can look at it and see whats wrong
i think you need to type stuff like pygame.init() and you have to flip the display stuff like that, like i said i'm not too sure but if you go on the pygame website http://www.pygame.org they might have something in the documentaion or go on their irc channel
a snippet of your code might be good?
then someone can look at it and see whats wrong
This the most basic test for PyGame that I have, give it a fly ...
[php]import pygame
from pygame.locals import *
yellow = (255,255,0) # RGB color tuple
# initialise screen
pygame.init()
screen = pygame.display.set_mode((350, 250))
pygame.display.set_caption('Basic Pygame program')
# fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(yellow)
# display some text
font = pygame.font.Font(None, 36)
text = font.render("Hello from Monty PyGame", 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
background.blit(text, textpos)
# blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
# event loop
while 1:
for event in pygame.event.get():
if event.type == QUIT:
raise SystemExit
screen.blit(background, (0, 0))
pygame.display.flip()
[/php]
Powerful stuff that SDL, mind you, just a little complex at first blush!
[php]import pygame
from pygame.locals import *
yellow = (255,255,0) # RGB color tuple
# initialise screen
pygame.init()
screen = pygame.display.set_mode((350, 250))
pygame.display.set_caption('Basic Pygame program')
# fill background
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(yellow)
# display some text
font = pygame.font.Font(None, 36)
text = font.render("Hello from Monty PyGame", 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
background.blit(text, textpos)
# blit everything to the screen
screen.blit(background, (0, 0))
pygame.display.flip()
# event loop
while 1:
for event in pygame.event.get():
if event.type == QUIT:
raise SystemExit
screen.blit(background, (0, 0))
pygame.display.flip()
[/php]
Powerful stuff that SDL, mind you, just a little complex at first blush!
May 'the Google' be with you!
Make sure you have the right version of PyGame downloaded. I use Windows XP and Python24 so I downloaded the installer file:
pygame-1.6.win32-py2.4.exe
from http://www.pygame.org/
pygame-1.6.win32-py2.4.exe
from http://www.pygame.org/
May 'the Google' be with you!
![]() |
Similar Threads
- Wireless adapter causes my Windows XP to freeze (Networking Hardware Configuration)
- Microsoft Changes The Game Plan: Windows 2003 A True NOS? (Windows NT / 2000 / XP)
Other Threads in the Python Forum
- Previous Thread: For Loops
- Next Thread: JPEG Image Embedded in Python
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment avogadro backend beginner binary bluetooth book builtin calculator character code converter countpasswordentry curved customdialog dan08 dictionaries dictionary dynamic examples exe file float format function gnu graphics gui heads homework ideas import inches input java launcher library line lines linux list lists loop mouse mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable wordgame write wxpython xlib






