PySnake devlog 3.8.2020 – gameover scene

I put this little effect when the game is over to avoid an abrupt change from the game to the menu. Added also a sound of a robotic voice that says game over, until I find a better effect.

https://github.com/formazione/snake

(repository)

def gameover():
    def surface(redux):
        main = pygame.Surface((Costants.w - redux, Costants.h - redux))
        if (redux // 20) % 2 == 0:
            main.fill((0,0,0))
        else:
            main.fill((64, 64, 64))
        Costants.window.blit(main, (redux, redux))
        Costants.screen.blit(pygame.transform.scale(main, ((Costants.w - redux) * 2, (Costants.h - redux) * 2)), (redux, redux))
        # pygame.time.delay(5)
        pygame.display.update()
        Costants.clock.tick(20)


    play("over")
    for x in range(20):
        surface(x * 20)

Video devlog Pysnake 1.9.4

Experimenting with sounds and some gameplay ideas


Subscribe to the newsletter for updates
Tkinter templates
Avatar My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.