コード例 #1
0
ファイル: Menu.py プロジェクト: Solivagant/Flashlight-JI
    def __init__(self, screen):
        self.screen= screen
        self.background = load_image("fundo_menu.png", "res/img")

        self.menu = cMenu(MENUSTART, self.screen, self.background)

        # criar recurso audio e fazer load do audio menu inicial e dos
        # efeitos menu
        self.audio = AudioResource.AudioResource()
        self.audio.AddMusic('res/music/menu1.mp3', 'menu1')

        self.audio.AddSoundFXList([('res/music/menuselect.wav', 'menuselect'),
                ('res/music/gunshot.wav', 'gunshot'), ])
        
        #INICIALIZaCAO DAS VARIAVEIS DE ESTADO DO MENU E DO LISTENER
        self.input = inputListener()

        #Iniciar musica menu
        self.audio.get_music('menu1').load_music()
        pygame.mixer.music.play(-1)
        
        self.gameIsRunning = False
        
        self.state = 0
        self.menustate = (0, 'MAINMENU')
        self.maxstate = self.menu.numStates()        
コード例 #2
0
ファイル: Game.py プロジェクト: Solivagant/Flashlight-JI
    def creation(self):
        #Relogio, importante para o refresh rate do jogo
        self.clock = pygame.time.Clock()
        
        #Stat
        self.correctTime = 0
        self.realTime = 0
        self.Weapon = Weapon2((280,25))
        self.life = Life((950,25))
        self.text_effect = 0
        self.client = None
        self.lights_off = True
        #variavel para saber quem matou este player
        self.killer = ""
        self.dead = False
        self.name = "DefaultName"
        self.skin = "player_five"
        self.status = Text((0,0), "", 1, None, (255,255,255))
        #Mira
        self.crosshair = crosshair((10, 10))
         
        #Grupos de Sprites das Balas, Jogadores
        self.bullets = pygame.sprite.Group()
        self.players = pygame.sprite.Group()
        
        #Listas de objectos a desenhar no ecra
        self.drawableObjects = []               #objectos a desenhar debaixo a sombra
        self.drawableObjectsSpritesLights = []  #objectos a desenhar por cima da sombra
        self.drawableTextLights = []            #texto a desenhar por cima da sombra
        self.toDelete = []                      #objectos a apagar no ciclo corrente
        
        self.isMulti =  False
        self.msg = None
        self.SEND_MESSAGE = False
        
        #Guardar a ultima mensagem de som enviada
        self.LastMsgInfo = [Text((0,0), "", 40, None, RED), 0]
       

        #Iniciar o input listener
        self.input = inputListener()
        
        #Criacao das superficies que permitem o desenho de sombras
        self.create_light_surfaces()
        
        #Exibir o cursor do rato (nao e a mira)
        pygame.mouse.set_visible(1)
コード例 #3
0
ファイル: Stat.py プロジェクト: Solivagant/Flashlight-JI
 def __init__(self, screen):
     self.screen= screen
     self.background = load_image("stat_game.png", "res/img")
     self.input = inputListener()
     self.drawableTextLights = []