Adding sounds to a game in pygame

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

blob:https://pythonprogramming.altervista.org/e2c68c2d-5520-4d28-b3e5-bbad71da8e9d

https://pythonprogramming.altervista.org/wp-content/uploads/2022/01/Pygame-Platformer-2022-01-12-09-22-20.mp4
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
My youtube channel

Twitter: @pythonprogrammi - python_pygame

Videos

Speech recognition game

Pygame's Platform Game

Other Pygame's posts