Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/game/PresentationState.py
blob: e7eeaddf05e6e07d5b23cebea5a8cec1fb2aaeb9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# -*- 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 *
from api.Sprite2 import CSprite

#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/selectArea/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/selectArea/T-elisa.png')
        self.mElisa.setImage(elisa)
        CGame().addChild(self.mElisa)
        
        self.mJuan = CSprite()
        self.mJuan.setXY(150, 300)
        juan = Image.loadImage('assets/images/selectArea/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/selectArea/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