diff options
author | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-11-11 05:18:54 (GMT) |
---|---|---|
committer | Mateu Batle <mateu.batle@collabora.co.uk> | 2010-11-11 05:18:54 (GMT) |
commit | b36f5b8aad1aa66e2d6775ad2d8931170378ea2f (patch) | |
tree | e1ce5d97c33d8e8a7e1b03ffcdba8e1a7c3d6364 /game2 | |
parent | 80a86f5984710328599167fe9187557aa103a77c (diff) |
Delayed background loading in game 2
Diffstat (limited to 'game2')
-rwxr-xr-x | game2/game2.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/game2/game2.py b/game2/game2.py index 95450ea..dd0d6e1 100755 --- a/game2/game2.py +++ b/game2/game2.py @@ -8,6 +8,7 @@ from gettext import gettext as _ import sys import random import time +from usmpgames import * #from constants import * #from classes import * #from methods import * @@ -123,8 +124,7 @@ class Game2(usmpgames.ApplicationState): imageList = [image1,image2,image3] imageList2 = [] - global background, bunnyImage, bunnyImage - background = load_image('./media/images/yard.jpg'); + global bunnyImage, bunnyImage bunnyImage = pygame.image.load('./media/images/cuy.png') bunnyImage = pygame.transform.scale(bunnyImage, (bunnySize-45, bunnySize)) @@ -163,6 +163,7 @@ class Game2(usmpgames.ApplicationState): a= round(time.time(),0) #print ('loopTime: '+str(a)) compareTime(a, self) + background = Application.get_resource_background ('./media/images/yard.jpg') self.screen().blit(background, (0,0) ) surface = self.screen() @@ -337,6 +338,7 @@ class Game2(usmpgames.ApplicationState): carrots.remove(b) # Draw background on game + background = Application.get_resource_background ('./media/images/yard.jpg') self.screen().blit(background, (0,0) ) #surface.fill(BACKGROUNDCOLOR) |