Permalink
Browse files

added sidescroller example

  • Loading branch information...
2 parents fb918c7 + 108c6fd commit 8b17fc1169a947606077e154c3cc7a1160ca4ca3 Alec Goebel committed Apr 9, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 samplecode/camera_example/gamelib/images.py
@@ -26,11 +26,13 @@ def load(self, name, colorkey=None):
if name not in self._images:
path = os.path.join(DATA_DIR, "images", name) + ".bmp"
image = pygame.image.load(path).convert()
- if colorkey:
- if colorkey == -1:
- colorkey = image.get_at((0,0))
- image.set_colorkey(colorkey)
-
self._images[name] = image
- return self._images[name].convert()
+ image = self._images[name].convert()
+ if colorkey:
+ if colorkey == -1:
+ colorkey = image.get_at((0,0))
+ image.set_colorkey(colorkey)
+
+
+ return image

0 comments on commit 8b17fc1

Please sign in to comment.