1. Pyroom
  2. Tutorials
  3. Python Tkinter
  4. 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

  1. Create a Canvas and draw a coin and a player.
  2. A move function shifts the player. bind connects the arrow keys to it.
  3. Run it and click the canvas so it gets the keys.
  4. 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.

Try it in the Playground

Nothing to install and no account needed.

Open Playground →