Creating Minesweeper using BeeWare, Python, and Pygame

David Such
4 min readApr 9, 2024

Up until now we have been using Toga as the GUI framework for BeeWare. This is not well suited for games, so we wanted to try Pygame which is another GUI option when generating an app using briefcase (Figure 1). It all went very smoothly, everything just worked.

Figure 1. GUI Framework Options in Briefcase

Pygame is a cross-platform set of Python modules designed for writing video games. It includes computer graphics and sound libraries designed to be used with the Python programming language. Pygame is highly portable and runs on nearly all platforms (macOS, Windows, and Linux). It’s open-source and free to use, even for commercial projects.

Figure 2. The BeeWare mascot as visualised by DALL-E

Pygame is built on top of the SDL library (Simple DirectMedia Layer), leveraging its capabilities for low-level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL or DirectX.

Detonique

We didn’t want to spend a lot of time building the game mechanics, so we went with a relatively simple game design. Our game will be called Detonique and will be based on Minesweeper.

--

--

David Such

Reefwing Software · Embedded Systems Engineer · iOS & AI Development · Robotics · Drones · Arduino · Raspberry Pi · Flight Control