|
|
2008-07-12
, 17:10
|
|
|
Posts: 696 |
Thanked: 1,012 times |
Joined on Mar 2006
@ Asturies, Spain
|
#2
|
screen = pygame.display.set_mode((640, 480), 0, 32)
screen = pygame.display.set_mode((640, 480), 0, 16)
| The Following User Says Thank You to yerga For This Useful Post: | ||
Now I am attempting to become more familiar with Python and PyGame. I'm trying to work with some of the scripts from Will McGugan's Beginning Game Development with Python and Pygame.
When I attempt to run the following script
#!/usr/bin/env python background_image_filename = 'sushiplate.jpg' mouse_image_filename = 'fugu.png' import pygame from pygame.locals import * from sys import exit pygame.init() screen = pygame.display.set_mode((640, 480), 0, 32) pygame.display.set_caption("Hello, World!") background = pygame.image.load(background_image_filename).convert() mouse_cursor = pygame.image.load(mouse_image_filename) while True: for event in pygame.event.get(): if event.type == QUIT: exit() screen.blit(background, (0,0)) x, y = pygame.mouse.get_pos() x-= mouse_cursor.get_width() / 2 y-= mouse_cursor.get_height() / 2 screen.blit(mouse_cursor, (x, y)) pygame.display.update()