So I'm building a suite of libraries that:
- Makes it easy to get visual or audio effects
- Gives immediate results (like Scratch does), type some commands, press run, see results
- Runs easily on the Raspberry Pi
- Has depth with plenty to explore.
I've started with a game of Pong - just a bat and ball, and some bricks to knock out. Here's an example of an early version, with just the bat and ball:
from geekclub.pyscratch import *
ball_img = PhotoImage(file='geekclub/images/face.gif')
bat_img = PhotoImage(file='geekclub/images/bat.gif')
ball = Sprite(ball_img)
ball.speed_x = random.randint(-4,4) * 2
ball.speed_y = random.randint(-4,4) * 2
bat = Sprite(bat_img)
ball.speed_y = -abs(ball.speed_y)
The full version is on Github https://github.com/ericclack/geekclub together with more examples.
Inspired by MIT Scratch: http://scratch.mit.edu/