diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2013-08-11 23:30:38 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2013-08-11 23:30:38 (GMT) |
commit | 4508a939d037888212edc3ae59edfcf9a437dc81 (patch) | |
tree | e2c37467a53930372a9f7c344968e22af30f7f3a /src/game/PresentationState.py | |
parent | cc4ad7638b93bae1070b8d55ba8fe581392f1d79 (diff) |
add presentation file
Diffstat (limited to 'src/game/PresentationState.py')
-rw-r--r-- | src/game/PresentationState.py | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/game/PresentationState.py b/src/game/PresentationState.py new file mode 100644 index 0000000..bef58fd --- /dev/null +++ b/src/game/PresentationState.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +import pygame + +import api.GameState +from api.GameState import CGameState +import api.MultiLabel +from api.MultiLabel import CMultiLabel +import api.Game +from api.Game import CGame +import api.Button +from api.Button import CButton +import game.CreditsState +from CreditsState import * + +import game.SelectAreaState +from SelectAreaState import * + +import api.Image as Image + +from gettext import gettext as _ + +class CPresentationState(CGameState): + + mBackground = None + mCount = 0 + + def init(self): + CGameState.__init__(self) + + self.mBackground = Image.loadImage('assets/images/map/background.png', False) + CGame().setBackground(self.mBackground) + + self.mElisa = CSprite() + #ancho = 216 -> 1200 - 216 - juan.X = 834 + self.mElisa.setXY(834, 300) + elisa = Image.loadImage('assets/images/map/T-elisa.png') + self.mElisa.setImage(elisa) + CGame().addChild(self.mElisa) + + self.mJuan = CSprite() + self.mJuan.setXY(150, 300) + juan = Image.loadImage('assets/images/map/T-juan.png') + self.mJuan.setImage(juan) + CGame().addChild(self.mJuan) + + self.mTitle = CSprite() + #ancho = 447 -> (1200 - 447 ) / 2 = 376 + self.mTitle.setXY(376, 193) + self.mImageTitle = Image.loadImage('assets/images/map/T-rotulo.png') + self.mTitle.setImage(self.mImageTitle) + CGame().addChild(self.mTitle) + + def update(self): + #print "menu update" + CGameState.update(self) + self.mCount = self.mCount + 1 + + if self.mCount > 150: + print "clicked credits" + #cs = CHelpState() + credits = CCreditsState() + CGame().setState(credits) + return + + def destroy(self): + CGameState.destroy(self) + CGame().removeChild(self.mElisa) + self.mElisa.destroy() + self.mElisa = None + CGame().removeChild(self.mJuan) + self.mJuan.destroy() + self.mJuan = None + CGame().removeChild(self.mTitle) + self.mTitle.destroy() + self.mTitle = None + self.mBackground = None + print "CMenuState destroy" + + def doEvents(self, aEvent): + print aEvent.type + |