Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-09-10 01:46:57 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-09-10 01:46:57 (GMT)
commitb89e3145438eade2be2c2caa23f1ff90c7bc63e0 (patch)
treecd3f5a30592e46c69540c4070376e63a8d8fbf28 /src
parent7ebaf4d32168f877ed2feaeed40a4f2afe5ac62e (diff)
show next question after anim in a1g4
Diffstat (limited to 'src')
-rw-r--r--src/game/Area1Game4.py34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/game/Area1Game4.py b/src/game/Area1Game4.py
index 4c3f4e8..6643747 100644
--- a/src/game/Area1Game4.py
+++ b/src/game/Area1Game4.py
@@ -7,6 +7,7 @@ import api.Image as Image
from api.Game import CGame
from api.GameState import CGameState
from api.Button import CButton
+from api.Globe import Globe
from api.Sprite2 import CSprite
from api.MultiLabel import CMultiLabel
from api.Points import CPoints
@@ -44,9 +45,9 @@ class CArea1Game4(CGameState):
self.mQuestions.append(q)
button = CButton()
button.set_bgColor((255, 125, 0))
- button.font = pygame.font.Font('assets/fonts/DejaVuSans.ttf', 22)
+ button.font = pygame.font.Font('assets/fonts/DejaVuSans.ttf', 26)
#button.set_center((110, 650))
- button.set_size((200, 40))
+ button.set_size((230, 40))
button.set_text(q[1])
self.mButtonList.append(button)
CGame().addChild(button)
@@ -55,7 +56,7 @@ class CArea1Game4(CGameState):
CGame().setBackground(self.mBackground)
self.mBook = CSprite()
- self.mBook.setXY(300, 100)
+ self.mBook.setXY(316, 100)
self.mBook.loadImage('assets/images/a1g4/A1G4-libro.png')
CGame().addChild(self.mBook)
@@ -85,12 +86,18 @@ class CArea1Game4(CGameState):
self.mQuestionsL = range(6)
random.shuffle(self.mQuestionsL)
- self.mLabelQuestion = CMultiLabel(transparent=True)
+ self.mLabelQuestion = CMultiLabel()
+ self.mLabelQuestion.bgColor = (252, 175, 23)
+ self.mLabelQuestion.set_font(fontSize=28)
self.mLabelQuestion.set_center((600, 250))
- self.mLabelQuestion.set_size((400, 100))
+ self.mLabelQuestion.set_size((380, 150))
self.mLabelQuestion.set_text(self.mQuestions[self.mQuestionsL[self.mCurrentQuestion]][0])
CGame().addChild(self.mLabelQuestion)
+ t = unicode('Ăšltima pregunta', 'UTF-8')
+ self.mLabelEnd = Globe((400, 100), pico='None', text=t)
+ self.mLabelEnd.set_center((600, 400))
+
def update(self):
CGameState.update(self)
@@ -124,12 +131,7 @@ class CArea1Game4(CGameState):
self.mPoints.set_bads(self.mBad)
CGame().addChild(self.mBadSprite)
self.mLocalState = STATE_ANIM
- self.mCurrentQuestion = self.mCurrentQuestion + 1
- if not(self.mCurrentQuestion == 6):
- self.mLabelQuestion.set_text(self.mQuestions[self.mQuestionsL[self.mCurrentQuestion]][0])
- else:
- CGame().removeChild(self.mLabelQuestion)
- print 'ultima'
+
else:
print 'fin preguntas'
else:
@@ -139,6 +141,15 @@ class CArea1Game4(CGameState):
CGame().removeChild(self.mGoodSprite)
CGame().removeChild(self.mBadSprite)
self.mLocalState = STATE_ANSWER
+ self.mCurrentQuestion = self.mCurrentQuestion + 1
+ print 'estado de preguntas', self.mCurrentQuestion
+ if not(self.mCurrentQuestion == 6):
+ self.mLabelQuestion.set_text(self.mQuestions[self.mQuestionsL[self.mCurrentQuestion]][0])
+ else:
+ CGame().addChild(self.mLabelEnd)
+ CGame().removeChild(self.mBook)
+ CGame().removeChild(self.mLabelQuestion)
+ print 'ultima'
def destroy(self):
@@ -150,6 +161,7 @@ class CArea1Game4(CGameState):
CGame().removeChild(self.mBook)
CGame().removeChild(self.mGoodSprite)
CGame().removeChild(self.mBadSprite)
+ CGame().removeChild(self.mLabelEnd)
self.mButtonBackA1G4 = None
self.mBackground = None
self.mLabelDefinition = None