Alien

Get started by following the introductory instructions here

The image and the sound used here is already provided in Pygame Zero. To make a basic animation, write out this code in mu:

draw() and update() are continuously run - approx 60 times a second. draw() controls what you see, and update() controls the game mechanics.

on_mouse_down() is called when the mouse left button is clicked. (pos) is the x,y coordinates on the screen.

It should look like this:

Try clicking on the alien. Try clicking the black background.

Using the previous code, when you click on the alien the costume changes but it does not change back. To fix that, try this code:

clock.schedule_unique(function name,time in seconds) is a way to schedule functions to run after a timed delay

Done that? Now try Alien Attack