Adding sounds to a game in pygame

https://github.com/formazione/platformworlds.git

def steps():
    if timecnt % 16 == 0:
        click.play()

timecnt = 0
while True: # game loop
    timecnt += 1

The steps function to make the steps

This is where I call it

    if player_movement[0] > 0:
        steps()
        player_flip = False
        player_action,player_frame = change_action(player_action,player_frame,'run')

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.