Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/game2/game2.py
diff options
context:
space:
mode:
Diffstat (limited to 'game2/game2.py')
-rwxr-xr-xgame2/game2.py44
1 files changed, 38 insertions, 6 deletions
diff --git a/game2/game2.py b/game2/game2.py
index 3c27abd..482d9ef 100755
--- a/game2/game2.py
+++ b/game2/game2.py
@@ -76,6 +76,11 @@ invisible=pygame.transform.scale(sad, (bunnySize-25, bunnySize))
looking=pygame.image.load('./media/images/looking.png')
looking=pygame.transform.scale(looking, (bunnySize-45, bunnySize))
+message_ok = pygame.image.load('./media/images/bien.png')
+message_bad = pygame.image.load('./media/images/mal.png')
+rect_ok = message_ok.get_rect()
+rect_bad = message_bad.get_rect()
+
#NUMBERS
number1=0
number2=0
@@ -400,7 +405,11 @@ class Game2(usmpgames.ApplicationState):
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)
+ rect_ok.center = ( WINDOWWIDTH / 2, WINDOWHEIGHT / 2 )
+ global rect_ok, message_ok
+ surface.blit(message_ok, rect_ok)
+ drawText(_("BIEN !"), font, surface, rect_ok.left + 125, rect_ok.top + 125, TEXTCOLOR)
+ #drawText(_('RESPUESTA CORRECTA!'), font, surface, (WINDOWWIDTH / 3.5), (WINDOWHEIGHT / 2.25), TEXTCOLOR)
if(GAMEMODE==3):
n=n+1
n=min(10,n)
@@ -409,7 +418,7 @@ class Game2(usmpgames.ApplicationState):
n=min(49,n)
#print ('n cambio a :'+str(n))
- drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 50,TEXTCOLOR)
+ #drawText(_('PULSA UNA TECLA'), font, surface, (WINDOWWIDTH / 3), (WINDOWHEIGHT / 2.25) + 50,TEXTCOLOR)
musicSound.stop()
correctAnswerSound.play()
score=returnScore()
@@ -422,10 +431,33 @@ class Game2(usmpgames.ApplicationState):
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)
+ #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)
+ global rect_bad, message_bad
+ rect_bad.center = ( WINDOWWIDTH / 2, WINDOWHEIGHT / 2 )
+ rect_bad.left = rectBunny.left - 150
+ if rect_bad.left < 0:
+ rect_bad.left = 0
+ if rect_bad.right > WINDOWWIDTH:
+ rect_bad.right = WINDOWWIDTH
+ surface.blit(message_bad, rect_bad)
+ drawText(_("INCORRECTO"), font, surface, rect_bad.left + 30, rect_bad.top + 70, TEXTCOLOR)
+ text = ""
+ if(GAMEMODE==1):
+ #This draw the operation
+ text = _('%d+%d') % (number1,number2)
+ elif(GAMEMODE==2):
+ #This draw the operation
+ text = _('%d-%d') % (number1,number2)
+ elif(GAMEMODE==3):
+ #This draw the operation
+ text = _('%dx%d') % (number1,number2)
+ elif(GAMEMODE==4):
+ #This draw the operation
+ text = ""
+ drawText(text, font, surface, rect_bad.left + 50, rect_bad.top + 170, TEXTCOLOR)
+ drawText(str(result), font, surface, rect_bad.left + 260, rect_bad.top + 170, TEXTCOLOR)
musicSound.stop()
gameOverSound.play()
pygame.display.update()