Example #1
0
from menu import Menu
from play import Play
from dificuldade import Dificuldade
from PPlay.window import Window
import globais

janela = Window(globais.WIDTH, globais.HEIGHT)
janela.set_title("Space Invadors")
janela.set_background_color((0, 0, 0))

menu = Menu(janela)
play = Play(janela)
dificuldade = Dificuldade(janela)

while globais.JOGO_RODANDO:
    janela.set_background_color((0, 0, 0))

    if (globais.PAGINA_ATUAL == 0):
        menu.setMenu()
    elif (globais.PAGINA_ATUAL == 1):
        play.setPlay()
    elif (globais.PAGINA_ATUAL == 2):
        dificuldade.setDificuldade()

    janela.update()
Example #2
0
from PPlay.sprite import Sprite
from PPlay.animation import Animation
from PPlay.window import Window
from posicoesTeste import Posicoes
from PPlay.keyboard import Keyboard
import globais

janela = Window(800, 600)
janela.set_title('teste')
janela.set_background_color((0, 0, 0))
posicoes = Posicoes(janela)
teclado = Keyboard()
posicoes.setUpdate()

while (True):
    janela.set_background_color((0, 0, 0))

    if (teclado.key_pressed("UP")):
        globais.STATUS_PERSONAGEM = 4

    posicoes.getUpdate()

    janela.update()
Example #3
0
# --------------- Global variables -------------------------------

game_state = 2  # Game starts showing menu

# Set display
background = GameImage('sprite/scenario/scenarionew.png')
menu_bg = GameImage('sprite/scenario/start1.png')
game_over = GameImage('sprite/scenario/GameOver1.png')
button = GameImage('sprite/scenario/button1.png', 0, -140)

# Define screen variables
sWidth = 512  # screen width
sHeight = 512  # screen height
window = Window(sWidth, sHeight)
window.set_title('Snowie Game')

# Managing points and health
score_manager = ScoreManager()  # Stores high score and last score
scorer = Scorer(window)  # Calculates points and health
record_checked = False

# Define branch variables
branchHeight = 64
treeHeight = GameImage('sprite/branches/middle.png').get_height()

# Define snowman variables
snowmanDist = 45  # Changes distance from tree
snowmanY = sHeight - 80  # Distance from bottom of screen
flakeDist = 50  # Flake distance from tree
snowmanH = 64  # Height of snowman
Example #4
0
from PPlay.window import Window
from PPlay.gameimage import GameImage
from arvore import Arvore
from bodybuilder import BodyBuilder
from pontuador import Pontuador
from highscoremanager import ScoreManager

janela = Window(512, 512)
janela.set_title('TimberBAM')

background = GameImage('sprite/cenario/cenarionew.png')
menu_bg = GameImage('sprite/cenario/start.png')
botao_inicial = GameImage('sprite/cenario/botao.png')
tela_final = GameImage('sprite/cenario/GAMEOVER.png')
score_manager = ScoreManager()

teclado = janela.get_keyboard()

arvore = Arvore(janela)
bambam = BodyBuilder(janela, 'esquerda')
pontuador = Pontuador(janela)

teclado_pressionado = False
record_checked = False

game_state = 2  # 0 - JOGANDO  1 - GAME-OVER  2- IN-MENU

while True:
    if game_state == 0:
        if teclado.key_pressed('left') or teclado.key_pressed('right'):
            if not teclado_pressionado: