I am running the slide puzzle program using Visual Studio Code. I have tried using both F5 (run in debug mode) and Ctrl+F5 (Run without debugging), and I get the same behavior.

Behavior – terminal opens and prints the following few lines, before apparently discontinuing or stalling.

@guarinod ➜ /workspaces/slide_puzzle (main) $  cd /workspaces/slide_puzzle ; /usr/bin/env /home/codespace/.python/current/bin/python3 /home/codespace/.vscode-remote/extensions/ms-python.python-2023.22.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 46739 -- /workspaces/slide_puzzle/slidepuzzle.py 
pygame 2.5.2 (SDL 2.28.2, Python 3.10.13)
Hello from the pygame community. https://www.pygame.org/contribute.html
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default

The above errors might not be causing the game to fail to display, however, they are the only log messages that are shown.

As mentioned elsewhere, I can suppress these errors with os.environ['SDL_AUDIODRIVER'] = 'dsp'. This still does not make the game display.

Disclaimer – I’m totally new to game development, which is why I am doing this beginner stuff

Already tried: the sudo apt-get install idea from this post

Expected for the alsa library to function correctly, as the commenters had suggested that uninstalled ALSA library or old ALSA library could create the issue. It made sense for me because I am totally new to pygame so I ought to need to install some modules.

New contributor

djguarino1992 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.