Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,22 @@ def __init__(self):
print "Pygame started."

#set up screen and background


# Let Pygame select the optimal color depth and use performance flags
self.screen = pygame.display.set_mode(
(self.SCREEN_WIDTH, self.SCREEN_HEIGHT), 0, 32)
self.tile_img = pygame.image.load(self.BG_TILE_IMG).convert_alpha()
(self.SCREEN_WIDTH, self.SCREEN_HEIGHT),
pygame.HWSURFACE | pygame.DOUBLEBUF | pygame.SCALED, # Use flags for performance/scaling
0 # Let Pygame choose the best color depth
)

# Load the image using os.path.join for better path handling and convert for optimized blitting
image_path = os.path.join("images", self.BG_TILE_IMG) # Adjust "images" if your path is different
self.tile_img = pygame.image.load(image_path).convert_alpha()

# Get the rect for positioning and manipulation
self.tile_img_rect = self.tile_img.get_rect()

#Drawing a handy MessageBoard widget
#Can use these for any text.
print "Configuring tboard MessageBoard params."
Expand Down