changeset 44:7e884084e7b1

Move animal sprites to imagecache.
author Simon Cross <hodgestar@gmail.com>
date Mon, 31 Aug 2009 16:49:59 +0000
parents fb5be14ea930
children 5106b82b56fb
files gamelib/animal.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/animal.py	Mon Aug 31 16:49:12 2009 +0000
+++ b/gamelib/animal.py	Mon Aug 31 16:49:59 2009 +0000
@@ -1,10 +1,8 @@
 """Class for the various animals in the game"""
 
-import pygame
-import random
 from pgu.vid import Sprite
 
-import data
+import imagecache
 
 class Animal(Sprite):
     """Base class for animals"""
@@ -28,7 +26,7 @@
     """A chicken"""
 
     def __init__(self, pos):
-        image = pygame.image.load(data.filepath('sprites/chkn.png'))
+        image = imagecache.load_image('sprites/chkn.png')
         Animal.__init__(self, image, pos)
 
     def move(self, gameboard):
@@ -44,7 +42,7 @@
     """A fox"""
 
     def __init__(self, pos):
-        image = pygame.image.load(data.filepath('sprites/fox.png'))
+        image = imagecache.load_image('sprites/fox.png')
         self.full = False
         Animal.__init__(self, image, pos)