How to capture the keyboard in the pygame during the game, where there is only sound?

Asked

Viewed 57 times

1

So guys. I’m visually impaired and I’m starting now in game programming, trying to make a pygame game, but using only sound. But in the main menu I want to press the down arrow it goes to a "new game" option, which I also wanted to learn how to create. And by pressing Esc he leaves the game. How do I do that? After entering new game, I want to open a text explaining the game and then the user would have to press the arrow keys to walk on the map and would like to play the sound of the steps. But I don’t know how to create maps or anything. Here’s my code

import pygame.mixer
from pygame.mixer import *
pygame.mixer.init()
pygame.mixer.music.load('musica.wav')
pygame.mixer.music.play(-1)
while pygame.mixer.music.get_busy():
    pygame.time.Clock().tick(10)
    m=input ('Menu principal, por favor selecione uma opção')
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.