Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateu Batle <mateu.batle@collabora.co.uk>2010-11-19 12:16:54 (GMT)
committer Mateu Batle <mateu.batle@collabora.co.uk>2010-11-19 12:16:54 (GMT)
commit1221a093713ca4d654255ab07f45ece07f69926a (patch)
tree30e15e425325fce66f45e6d3c2d46102a1d2c7fc
parenteba1989cfa57df275cd6c74825f21eda9cfa6a24 (diff)
restructure game2
fixed several bugs
-rwxr-xr-xgame2/game2.py518
1 files changed, 257 insertions, 261 deletions
diff --git a/game2/game2.py b/game2/game2.py
index d1089dc..08f1015 100755
--- a/game2/game2.py
+++ b/game2/game2.py
@@ -89,10 +89,6 @@ musicSound = pygame.mixer.Sound('./media/sounds/menumusic.ogg')
font = pygame.font.SysFont(None, 80)
-gameOverSound = None
-correctAnswerSound = None
-musicSound = None
-
imageList = []
imageList2 = []
@@ -131,6 +127,7 @@ class Game2(usmpgames.ApplicationState):
global bunnyImageF, rectBunny
bunnyImageF=MBSprite(bunnyImage)
rectBunny = bunnyImageF.rect
+ self.new_operation = True
def entering_state(self, fromStack):
@@ -145,6 +142,7 @@ class Game2(usmpgames.ApplicationState):
global score, a
score = 0
a = 0
+ self.new_operation = True
def exiting_state(self, fromStack):
global score
@@ -154,295 +152,291 @@ class Game2(usmpgames.ApplicationState):
color = (0, 0, 0, 0),
pos = (660, 260),
rectsize = (380, 390) );
- global musicSound
+ global gameOverSound, correctAnswerSound, musicSound
+ gameOverSound.stop()
musicSound.stop()
+ correctAnswerSound.stop()
+ pygame.mixer.music.stop()
usmpgames.ApplicationState.exiting_state(self, fromStack)
- def loop(self, ms):
+ def input(self, ms):
+ global carrotsBack, carrotsSlow, carrotsQuick, moveRight, moveLeft, score, rectBunny, moveUp
+
+ for event in pygame.event.get():
+ if event.type == QUIT:
+ self.set_running( False )
+ # KEYDOWN EVENTS
+ if event.type == KEYDOWN:
+ if event.key == ord('z'):
+ carrotsBack = True
+ if event.key == ord('x'):
+ carrotsSlow = True
+ if event.key == ord('c'):
+ carrotsQuick = True
+ if event.key == K_LEFT or event.key == ord('a') or event.key == K_KP4 or event.key== K_KP7:
+ moveRight = False
+ moveLeft = True
+ if event.key == K_RIGHT or event.key == ord('d') or event.key == K_KP6 or event.key== K_KP1:
+ moveLeft = False
+ moveRight = True
+ #Up and Down moves disabled
+ #if event.key == K_UP or event.key == ord('w') or event.key == K_KP8 or event.key== K_KP9:
+ #moveDown = False
+ #moveUp = True while(i<number1):
+
+ #if event.key == K_DOWN or event.key == ord('s') or event.key == K_KP2 or event.key== K_KP3:
+ #moveUp = False
+ #moveDown = True
+ # KEYUP EVENTS
+ if event.type == KEYUP:
+ if event.key == ord('z'):
+ carrotsBack = False
+ score = 0
+ if event.key == ord('x'):
+ carrotsSlow = False
+ score = 0
+ if event.key == ord('c'):
+ carrotsQuick = False
+ score= 0
+ if event.key == K_ESCAPE:
+ self.set_running( False )
+ if event.key == K_LEFT or event.key == ord('a') or event.key == K_KP4 or event.key== K_KP7:
+ moveLeft = False
+ if event.key == K_RIGHT or event.key == ord('d') or event.key == K_KP6 or event.key== K_KP1:
+ moveRight = False
+ #Up and Down moves disabled
+ #if event.key == K_UP or event.key == ord('w') or event.key == K_KP8 or event.key== K_KP9:
+ #moveDown = False
+ #moveUp = True
+ #if event.key == K_DOWN or event.key == ord('s') or event.key == K_KP2 or event.key== K_KP3:
+ #moveUp = False
+ #moveDown = True
+ # MOUSEMOTION EVENTS
+ if event.type == MOUSEMOTION:
+ # Follow mouse pointer
+ #rectBunny.move_ip(event.pos[0] - rectBunny.centerx, event.pos[1] - rectBunny.centery)
+ rectBunny.move_ip(event.pos[0] - rectBunny.centerx, 0)
+
+
+ def render(self, ms):
+ global carrotsBack, carrotsSlow, carrotsQuick, moveRight, moveLeft, score, rectBunny, moveUp, moveDown
+ global carrots, surface
global gameOverSound, correctAnswerSound, musicSound
global imageList, imageList2
global background, bunnyImage, bunnyImage
global bunnyImageF, rectBunny
global result
global n
-
- mainClock = pygame.time.Clock()
+ global newCarrotCounter
+
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()
+ if compareTime(a, self):
+ return
- #pygame.display.flip()
+ if self.new_operation:
+ self.new_operation = False
+ #print ('loopTime: '+str(a))
+ background = Application.get_resource_background ('./media/images/yard.jpg')
+ self.screen().blit(background, (0,0) )
+ surface = self.screen()
- # Initialize game start
- carrots = []
+ #pygame.display.flip()
- rectBunny.topleft = (WINDOWWIDTH / 2, WINDOWHEIGHT - 250)
- moveLeft = moveRight = moveUp = moveDown = False
- #Game Cheat
- carrotsBack = carrotsSlow = carrotsQuick = False
- newCarrotCounter = 0
- #pygame.mixer.music.play(-1, 0.0)
- musicSound.play(-1)
+ # Initialize game start
+ carrots = []
- global number1
- global number2
- global GAMEMODE
- if(GAMEMODE==1):
- #print('n: '+str(n))
- #random.randint(max(result-4,1), min(99,result+4))
- number1 = random.randint(max(n-5,0),n) + 1
- number2 = random.randint(max(n-5,0),n)
- #result=number1+number2
- result=100
- while (result>=100):
+ rectBunny.topleft = (WINDOWWIDTH / 2, WINDOWHEIGHT - 250)
+ moveLeft = moveRight = moveUp = moveDown = False
+ #Game Cheat
+ carrotsBack = carrotsSlow = carrotsQuick = False
+ newCarrotCounter = 0
+ #pygame.mixer.music.play(-1, 0.0)
+ musicSound.play(-1)
+
+ global number1
+ global number2
+ global GAMEMODE
+ if(GAMEMODE==1):
+ #print('n: '+str(n))
+ #random.randint(max(result-4,1), min(99,result+4))
number1 = random.randint(max(n-5,0),n) + 1
number2 = random.randint(max(n-5,0),n)
- result=number1+number2
-
- elif(GAMEMODE==2):
- #print('n: '+str(n))
- #random.randint(max(result-4,1), min(99,result+4))
- number1 = random.randint(max(n-15,0),n) + 1
- number2 = random.randint(max(n-15,0),n)
- z=min(number1,number2)
- number1=max(number1,number2)
- number2=z
- while (number1==number2):
+ #result=number1+number2
+ result=100
+ while (result>=100):
+ number1 = random.randint(max(n-5,0),n) + 1
+ number2 = random.randint(max(n-5,0),n)
+ result=number1+number2
+
+ elif(GAMEMODE==2):
+ #print('n: '+str(n))
+ #random.randint(max(result-4,1), min(99,result+4))
number1 = random.randint(max(n-15,0),n) + 1
number2 = random.randint(max(n-15,0),n)
z=min(number1,number2)
number1=max(number1,number2)
- number2=z
+ number2=z
+ while (number1==number2):
+ number1 = random.randint(max(n-15,0),n) + 1
+ number2 = random.randint(max(n-15,0),n)
+ z=min(number1,number2)
+ number1=max(number1,number2)
+ number2=z
+ result=number1-number2
result=number1-number2
- result=number1-number2
- elif(GAMEMODE==3):
- #print('n: '+str(n))
- #random.randint(max(result-4,1), min(99,result+4))
- number1 = random.randint(max(n-5,0),n+1)+1
- number2 = random.randint(max(n-5,0),n+1)+1
- while (number1>10 or number2 >10):
+ elif(GAMEMODE==3):
+ #print('n: '+str(n))
+ #random.randint(max(result-4,1), min(99,result+4))
number1 = random.randint(max(n-5,0),n+1)+1
number2 = random.randint(max(n-5,0),n+1)+1
- result=number1*number2
- result=number1*number2
- elif(GAMEMODE==4):
- #print('n: '+str(n))
- #random.randint(max(result-4,1), min(99,result+4))
- number1 = random.randint(1,9)
- #number1=9
- #number2 = random.randint(max(0,n-1),n)+1
- #result=number1+result2
- result=number1
- putImagesToList()
-
-
- #print ('number1: '+str(number1)+' number2: '+str(number2)+' result: '+str(result))
- while self.running(): # Score loop
- #score += 1 # increase score
-
- for event in pygame.event.get():
- if event.type == QUIT:
- self.set_running( False )
- # KEYDOWN EVENTS
- if event.type == KEYDOWN:
- if event.key == ord('z'):
- carrotsBack = True
- if event.key == ord('x'):
- carrotsSlow = True
- if event.key == ord('c'):
- carrotsQuick = True
- if event.key == K_LEFT or event.key == ord('a') or event.key == K_KP4 or event.key== K_KP7:
- moveRight = False
- moveLeft = True
- if event.key == K_RIGHT or event.key == ord('d') or event.key == K_KP6 or event.key== K_KP1:
- moveLeft = False
- moveRight = True
- #Up and Down moves disabled
- #if event.key == K_UP or event.key == ord('w') or event.key == K_KP8 or event.key== K_KP9:
- #moveDown = False
- #moveUp = True while(i<number1):
-
- #if event.key == K_DOWN or event.key == ord('s') or event.key == K_KP2 or event.key== K_KP3:
- #moveUp = False
- #moveDown = True
-
- # KEYUP EVENTS
- if event.type == KEYUP:
- if event.key == ord('z'):
- carrotsBack = False
- score = 0
- if event.key == ord('x'):
- carrotsSlow = False
- score = 0
- if event.key == ord('c'):
- carrotsQuick = False
- score= 0
- if event.key == K_ESCAPE:
- self.set_running( False )
-
- if event.key == K_LEFT or event.key == ord('a') or event.key == K_KP4 or event.key== K_KP7:
- moveLeft = False
- if event.key == K_RIGHT or event.key == ord('d') or event.key == K_KP6 or event.key== K_KP1:
- moveRight = FalscorrectAnswerSounderesult=0
- #Up and Down moves disabled
- #if event.key == K_UP or event.key == ord('w') or event.key == K_KP8 or event.key== K_KP9:
- #moveDown = False
- #moveUp = True
- #if event.key == K_DOWN or event.key == ord('s') or event.key == K_KP2 or event.key== K_KP3:
- #moveUp = False
- #moveDown = True
- # MOUSEMOTION EVENTS
- if event.type == MOUSEMOTION:
- # Follow mouse pointer
- #rectBunny.move_ip(event.pos[0] - rectBunny.centerx, event.pos[1] - rectBunny.centery)
-
- rectBunny.move_ip(event.pos[0] - rectBunny.centerx, 0)
-
-
- # Add new carrots on the screen
+ while (number1>10 or number2 >10):
+ number1 = random.randint(max(n-5,0),n+1)+1
+ number2 = random.randint(max(n-5,0),n+1)+1
+ result=number1*number2
+ result=number1*number2
+ elif(GAMEMODE==4):
+ #print('n: '+str(n))
+ #random.randint(max(result-4,1), min(99,result+4))
+ number1 = random.randint(1,9)
+ #number1=9
+ #number2 = random.randint(max(0,n-1),n)+1
+ #result=number1+result2
+ result=number1
+ putImagesToList()
+
+
+ # Add new carrots on the screen
+ if not carrotsBack and not carrotsSlow and not carrotsQuick:
+ newCarrotCounter += 1
+ if newCarrotCounter == CARROTVELFREC:
+ newCarrotCounter = 0
+ #carrotSize = random.randint(CARROTMINSIZE, CARROTMAXSIZE)
+ a=random.randint(0, 1)
+ if(a==0):
+ newCarrot=Carrots(fruit1Image,result)
+ else:
+ newCarrot=Carrots(fruit2Image,result)
+ carrots.append(newCarrot)
+
+ # Moves player
+ if moveLeft and rectBunny.left > 0:
+ rectBunny.move_ip(-1 * BUNNYMOVEVEL, 0)
+ if moveRight and rectBunny.right < WINDOWWIDTH:
+ rectBunny.move_ip(BUNNYMOVEVEL, 0)
+ if moveUp and rectBunny.top > 0:
+ rectBunny.move_ip(0, -1 * BUNNYMOVEVEL)
+ if moveDown and rectBunny.bottom < WINDOWHEIGHT:
+ rectBunny.move_ip(0, BUNNYMOVEVEL)
+
+ # Puts Bunny on the mouse pointer
+ pygame.mouse.set_pos(rectBunny.centerx, rectBunny.centery)
+
+ # Move carrots down
+ for b in carrots:
if not carrotsBack and not carrotsSlow and not carrotsQuick:
- newCarrotCounter += 1
- if newCarrotCounter == CARROTVELFREC:
- newCarrotCounter = 0
- #carrotSize = random.randint(CARROTMINSIZE, CARROTMAXSIZE)
- a=random.randint(0, 1)
- if(a==0):
- newCarrot=Carrots(fruit1Image,result)
- else:
- newCarrot=Carrots(fruit2Image,result)
- carrots.append(newCarrot)
-
- # Moves player
- if moveLeft and rectBunny.left > 0:
- rectBunny.move_ip(-1 * BUNNYMOVEVEL, 0)
- if moveRight and rectBunny.right < WINDOWWIDTH:
- rectBunny.move_ip(BUNNYMOVEVEL, 0)
- if moveUp and rectBunny.top > 0:
- rectBunny.move_ip(0, -1 * BUNNYMOVEVEL)
- if moveDown and rectBunny.bottom < WINDOWHEIGHT:
- rectBunny.move_ip(0, BUNNYMOVEVEL)
-
- # Puts Bunny on the mouse pointer
- pygame.mouse.set_pos(rectBunny.centerx, rectBunny.centery)
-
- # Move carrots down
- for b in carrots:
- if not carrotsBack and not carrotsSlow and not carrotsQuick:
- b.rect.move_ip(0, b.velocity)
- elif carrotsBack:
- b.rect.move_ip(0, -5)
- elif carrotsSlow:
- b.rect.move_ip(0, 1)
- elif carrotsQuick:
- b.rect.move_ip(0, 5)
-
- # Delete carrots when you can't see it on the screen
- for b in carrots[:]:
- if b.rect.top > WINDOWHEIGHT-150:
- 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)
+ b.rect.move_ip(0, b.velocity)
+ elif carrotsBack:
+ b.rect.move_ip(0, -5)
+ elif carrotsSlow:
+ b.rect.move_ip(0, 1)
+ elif carrotsQuick:
+ b.rect.move_ip(0, 5)
+
+ # Delete carrots when you can't see it on the screen
+ for b in carrots[:]:
+ if b.rect.top > WINDOWHEIGHT-150:
+ 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)
- # Draw enemies
- for b in carrots:
- surface.blit(b.image, b.rect)
- drawText(str(b.number), font, b.image, 15, 25, (255,255,255))
+ # Draw enemies
+ for b in carrots:
+ surface.blit(b.image, b.rect)
+ drawText(str(b.number), font, b.image, 15, 25, (255,255,255))
- # Show score and maximum score
- global maxScore
- global score
- drawText(_('PUNTAJE: %s') % (score), font, surface, 700, 0, TEXTCOLOR)
- drawText(_('MAXIMO: %s') % (maxScore), font, surface, 700, 60, TEXTCOLOR)
+ # Show score and maximum score
+ global maxScore
+ global score
+ drawText(_('PUNTAJE: %s') % (score), font, surface, 700, 0, TEXTCOLOR)
+ drawText(_('MAXIMO: %s') % (maxScore), font, surface, 700, 60, TEXTCOLOR)
- if(GAMEMODE==1):
- #This draw the operation
- drawText(_('SUMAR: %d + %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
+ if(GAMEMODE==1):
+ #This draw the operation
+ drawText(_('SUMAR: %d + %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
- elif(GAMEMODE==2):
- #This draw the operation
- drawText(_('RESTAR: %d - %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
+ elif(GAMEMODE==2):
+ #This draw the operation
+ drawText(_('RESTAR: %d - %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
- elif(GAMEMODE==3):
- #This draw the operation
- drawText(_('MULTIPLICAR: %d x %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
+ elif(GAMEMODE==3):
+ #This draw the operation
+ drawText(_('MULTIPLICAR: %d x %d') % (number1,number2), font, surface, 10, 0, TEXTCOLOR)
- elif(GAMEMODE==4):
- #This draw the operation
- drawText(_('CONTAR '), font, surface, 10, 0, TEXTCOLOR)
- medC=0
- i=0
- while(i<number1):
- #print('Iteracion: '+str(i))
- surface.blit(imageList2[i], (10+medC,60) )
- medC=medC+65
- i=i+1
-
- # Verify if Bunny eat carrot
- #if bunnyEatsC pygame.time.delay(2000)arrot(rectBunny, carrots):
- bunnyImageF.rect=rectBunny
-
- if bunnyEatsCarrot(bunnyImage, carrots):
- #print ('bunnyEatsCarrot(before): MaxScore'+str(maxScore)+' score: '+str(maxScore))
- #print 'if bunnyEatsCarrot(bunnyImage, carrots): score: '+str(score)
-
- if checkResult(result):
- rectBunny.move_ip(-35, 0)
- #surface.blit(happy, rectBunny)
- surface.blit(happy, rectBunny)
- drawText(_('RESPUESTA CORRECTA!'), font, surface, (WINDOWWIDTH / 3.5), (WINDOWHEIGHT / 2.25), TEXTCOLOR)
- if(GAMEMODE==3):
- n=n+1
- else:
- n=n+5
- #print ('n cambio a :'+str(n))
-
- drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 50,TEXTCOLOR)
- musicSound.stop()
- correctAnswerSound.play()
- score=returnScore()
- if score> maxScore:
- maxScore = score # Puts new score
- #print ('bunnyEatsCarrot(after): MaxScore'+str(maxScore)+' score: '+str(maxScore))
+ elif(GAMEMODE==4):
+ #This draw the operation
+ drawText(_('CONTAR '), font, surface, 10, 0, TEXTCOLOR)
+ medC=0
+ i=0
+ while(i<number1):
+ #print('Iteracion: '+str(i))
+ surface.blit(imageList2[i], (10+medC,60) )
+ medC=medC+65
+ i=i+1
+
+ # Verify if Bunny eat carrot
+ #if bunnyEatsC pygame.time.delay(2000)arrot(rectBunny, carrots):
+ bunnyImageF.rect=rectBunny
+
+ if bunnyEatsCarrot(bunnyImage, carrots):
+ #print ('bunnyEatsCarrot(before): MaxScore'+str(maxScore)+' score: '+str(maxScore))
+ #print 'if bunnyEatsCarrot(bunnyImage, carrots): score: '+str(score)
+
+ self.new_operation = True
+ if checkResult(result):
+ rectBunny.move_ip(-35, 0)
+ #surface.blit(happy, rectBunny)
+ surface.blit(happy, rectBunny)
+ drawText(_('RESPUESTA CORRECTA!'), font, surface, (WINDOWWIDTH / 3.5), (WINDOWHEIGHT / 2.25), TEXTCOLOR)
+ if(GAMEMODE==3):
+ n=n+1
else:
- surface.blit(sad, rectBunny)
- #surface.blit(sad, rectBunny)
- score=returnScore()
- drawText(_('RESPUESTA INCORRECTA!'), font, surface, (WINDOWWIDTH / 4), (WINDOWHEIGHT / 2.25), TEXTCOLOR)
- drawText(_('RESPUESTA CORRECTA: '+str(result)), font, surface, (WINDOWWIDTH / 3.8), (WINDOWHEIGHT / 2.25)+50, TEXTCOLOR)
-
- drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 100, TEXTCOLOR)
- musicSound.stop()
- gameOverSound.play()
- #print ('bunnyEatsCarrot(after): MaxScore'+str(maxScore)+' score: '+str(maxScore))
- break
+ n=n+5
+ #print ('n cambio a :'+str(n))
+
+ drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 50,TEXTCOLOR)
+ musicSound.stop()
+ correctAnswerSound.play()
+ score=returnScore()
+ if score> maxScore:
+ maxScore = score # Puts new score
+ #print ('bunnyEatsCarrot(after): MaxScore'+str(maxScore)+' score: '+str(maxScore))
+ pygame.display.update()
+ waitPlayerPressKey(self)
else:
- # Draw playerpygame.time.wait(2000) rectangle
-
- surface.blit(bunnyImage, rectBunny)
-
- pygame.display.update()
-
- mainClock.tick(FPS)
-
- pygame.mixer.music.stop()
-
- pygame.display.update()
- waitPlayerPressKey(self)
- #correctAnswerSound.stop()
- gameOverSound.stop()
-
+ surface.blit(sad, rectBunny)
+ #surface.blit(sad, rectBunny)
+ score=returnScore()
+ drawText(_('RESPUESTA INCORRECTA!'), font, surface, (WINDOWWIDTH / 4), (WINDOWHEIGHT / 2.25), TEXTCOLOR)
+ drawText(_('RESPUESTA CORRECTA: '+str(result)), font, surface, (WINDOWWIDTH / 3.8), (WINDOWHEIGHT / 2.25)+50, TEXTCOLOR)
+
+ drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 100, TEXTCOLOR)
+ musicSound.stop()
+ gameOverSound.play()
+ pygame.display.update()
+ waitPlayerPressKey(self)
+ #print ('bunnyEatsCarrot(after): MaxScore'+str(maxScore)+' score: '+str(maxScore))
+ else:
+ # Draw playerpygame.time.wait(2000) rectangle
+ surface.blit(bunnyImage, rectBunny)
######################################## methods
#Time Limit
-TIMELIMIT=240.0
-#TIMELIMIT=30.0
+#TIMELIMIT=240.0
+TIMELIMIT=10.0
#print ('time: '+str(TIMESTART))
def compareTime(playTime, gamestate):
@@ -452,7 +446,9 @@ def compareTime(playTime, gamestate):
if(c>TIMELIMIT):
#print ('Time Limit!')
#gamestate.set_running( False )
- gamestate.go_to_next_state()
+ gamestate.go_to_next_state()
+ return True
+ return False
#Loading Image Method
def load_image(fileName):
@@ -465,10 +461,10 @@ def load_image(fileName):
#Wait Player to Press Key Method
def waitPlayerPressKey(gamestate):
+ pygame.time.wait(300)
+ pygame.event.clear()
while True:
for event in pygame.event.get():
- pygame.time.wait(300)
- pygame.event.clear()
if event.type == QUIT:
gamestate.set_running( False )
if event.type == KEYDOWN:
@@ -534,7 +530,7 @@ def returnScore():
return a
-#Draw text on the screenine
+#Draw text on the screen
def drawText(text, font, surface, x, y, color):
text = font.render(text, 1, color)
rectText = text.get_rect()