From b36f5b8aad1aa66e2d6775ad2d8931170378ea2f Mon Sep 17 00:00:00 2001 From: Mateu Batle Date: Thu, 11 Nov 2010 05:18:54 +0000 Subject: Delayed background loading in game 2 --- (limited to 'game2') 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) -- cgit v0.9.1