Example #1
0
def draw(canvas):
    updateText(canvas)
    global timer
    if timer > 90:
        red.draw(canvas)
    if timer > 130:
        yellow.draw(canvas)
    if timer > 170:
        green.draw(canvas)
    if timer > 210:
        canvas.draw_text("Press any button to start!", (50, 450), 40, "White")
        if kbd.next:
            Master.menu()
    timer += 1
Example #2
0
 def handler(position):
     click = Vector(position[0], position[1])
     if Mouse.screen == "splash":  #todo change to dict
         Master.menu()
     elif Mouse.screen == "menu":
         Mouse.mainMenuButtons(click)
     elif Mouse.screen == "instructions":
         Master.menu()
     elif Mouse.screen == "game":
         Mouse.gameMenuButtons(click)
     elif Mouse.screen == "MultOrNo":
         Mouse.multiplayer(click)
     elif Mouse.screen == "lvlSelect":
         Mouse.lvlSelect(click)
     elif Mouse.screen == "spriteSelect":
         Mouse.spriSel(click)
     else:
         pass
Example #3
0
    def gameMenuButtons(click):
        #Red, yel and green correspond to the position of the buttons displayed during the game
        radius = 20
        red = Vector(30, 40)
        yel = Vector(80, 40)
        gre = Vector(130, 40)

        cenToClick = click.copy().subtract(
            red.copy())  # dist between centre of ball and click
        if (cenToClick.length() <= radius):  # check click is in ball
            quit(0)
        cenToClick = click.copy().subtract(
            yel.copy())  # dist between centre of ball and click
        if (cenToClick.length() <= radius):  # check click is in ball
            Master.instructions()
        cenToClick = click.copy().subtract(
            gre.copy())  # dist between centre of ball and click
        if (cenToClick.length() <= radius):  # check click is in ball
            # Master.gameLoop()
            Master.menu()
Example #4
0
def draw(canvas):
    if kbd.ai and round.startTimer % ai.loopsPerGo == 0:  ##allows the ai to select a move once every x cycles of the gameloop
        Ai.move(Ai)
        if round.startTimer % 20 == 0:  #stops moves lasting more than 20 cycles
            kbd.ai_keyup()
    round.startTimer += 1
    interactions.update(round)
    background.draw(canvas)
    player1.draw(canvas, player2)  #fireball drawing done in character draw
    player2.draw(canvas, player1)
    #platform_bottom.draw(canvas)
    if round.gameEnded:
        if round.startTimer < round.endTime + 180:
            round.drawend(canvas)

        else:
            #enter main menu
            kbd.key_up(next)
            round.gameEnded = False
            Master.menu()
    if round.startTimer < 180:
        round.draw(canvas)
Example #5
0
def draw(canvas):
    instructions(canvas)
    if kbd.next:
        kbd.key_up(next)
        Master.menu()
Example #6
0
def draw(canvas):
    storysplash(canvas)
    if kbd.next:
        kbd.key_up(next)
        Master.menu()