- Pyroom
- Tutorials
- Python Tkinter
- Make a Tkinter Canvas mini-game
Make a Tkinter Canvas mini-game
A Canvas draws shapes you can move. Binding keys to functions turns it into a game.
Advanced Video coming soon. The steps below show everything the video will cover.
Steps
- Create a Canvas and draw a coin and a player.
- A move function shifts the player. bind connects the arrow keys to it.
- Run it and click the canvas so it gets the keys.
- Use the arrow keys to move the player to the coin.
Read the transcript
Create a Canvas and draw a coin and a player.
A move function shifts the player. bind connects the arrow keys to it.
Run it and click the canvas so it gets the keys.
Use the arrow keys to move the player to the coin.
More Python Tkinter tutorials
- Make a Tkinter window with a button · Beginner
- Build a Tkinter form with Entry and Label · Intermediate