Skip to content

Step up from MIT Scratch to Python with this simple games library, as seen at Brighton Coder Dojo and STEM school visits. Runs on default Python install with Tkinter for graphics.

License

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
doc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TKGameLib: Step up from Scratch to Python

Inspired by MIT Scratch and PygameZero, answers the question "what should I try after Scratch?"

Take a look at TKGameLib in action in this short video: https://youtu.be/J0MHYo8oftU

PygameZero is really cool, but it requires extra libraries to be installed so isn't an option in some organisations such as schools. TKGameLib works on the default Python, it uses TKinter for graphics, sprites etc, and is designed to encourage exploration of everything.

Project aims:

  • Make it easy to create visual or audio effects
  • Give immediate results (like Scratch does), type some commands, press run, see results
  • Run easily on the Raspberry Pi
  • Run easily on Windows PCs in schools, to support my STEM Ambassador work
  • Provide depth with plenty to explore.

Screen shots

boulder screen shot

pong screen shot

fractal trees screen shot

Prerequesites

  • Python 3
  • A working tkinter library

Get the code

You can use git or download a zip file of the code:

git clone https://github.com/ericclack/tkgamelib.git

Examples

Start up IDLE3 and create a new file, save it to the directory my_work, then add the following code...

from packages import *
  
create_canvas()
sprite = ImageSprite('my_images/face.gif')
sprite.pen_down()

def move_sprite(event):
    sprite.move(10,10)

when_key_pressed('<space>', move_sprite)
mainloop()

Documentation

Check out the examples directory. You should be able to run the code straight from that directory.

Have a look at the wiki to get started. Or you can view the source code of the library.

About

Step up from MIT Scratch to Python with this simple games library, as seen at Brighton Coder Dojo and STEM school visits. Runs on default Python install with Tkinter for graphics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages