Notes for CoderDojo Tramore (python).
This is a collection of worksheets covering programming in python.
This subset of worksheets were based around the turtle
module. We used the python editor Thonny across OSX, Linux and windows.
-
01-Guess_my_Number
Simple guessing game to demo storing data, looping and making decisions. Very little code is given as worksheet was intended to be augmented with one-on-one instruction. -
02-Take_Away
Simple game that we first implement on the console and later we will develop a graphical version. -
03-Graphical_Take_Away
Introduction to drawing using theturtle
module. -
04-Some_More_Turtle_Graphics
In this worksheet we will build more complicated drawings usingturtle
module. -
05-Doing_Physics_with_Python
This worksheet is a little different. Here we use python to see how objects behave when they are dropped from a height or thrown upwards. -
06-Graphical_Take_Away_-_Second_Time_Lucky
Finally we return to our Take Away game and implement a graphical version usingturtle
graphics. -
07-Monkey_Wars
OK, we are ready for more complicated games. This time we will build our version of the classic Monkey Wars game. -
08-Working_with_Lists
This is the first of our worksheets intended to cover various fundamental programming concepts. In this worksheet we will look at lists. -
11-Building_a_GUI
In this worksheet we will develop a simple graphical interface which we can use to control our other python games and programs. -
12-Happy_Holidays
We build some animated e-cards using theturtle
module. -
15-Cellular_Automation
This worksheet is much more advanced and uses cellular automation to simulate how fires spread in a forest.
In January 2020 we switched focus and:
- Moved from
turtle
to Pygame Zero (pgzero) for graphics. Pygame Zero is a layer on top of
pygame and simplifies game development for new programmers. - Switched editor from Thonny to Mu. The Mu editor has a nicer interface and has some nice tools to identify and fix coding style issues (now if only it could fix my spelling ...). Recent versions of Thonny also support pgzero so you can continue to use that if you wish.
In the following worksheets, the plan is to give the steps to build the basic game idea, and then give suggestions/outlines on how this game idea can be further developed into a proper game. Many of the game ideas from the excellent book Coding Games in Python (Computer Coding for Kids) and from suggestions from the coders themselves.
-
- Basic game idea
- Adding sound effects and background music
- Using physics to get moving targets
- Having lives to deal with missing the target
- Multiple fruit (and non-fruit) targets
-
- Basic game idea
- Adding sound effects and background music
- Multiple levels with increasing difficulty
- Different and vanishing targets
-
- Basic game idea
- Adding lives, game title, and sound as per earlier games
- Multiple level games
- Variations of basic game idea to try to reach a given total
-
Geometry Dash games
- The YouTube channel KidsCanCode is excellent, and has separate series of tutorials for:
- Learning to Code in Python which uses turtle graphics.
- Game Development with PyGame covers writing game using the PyGame library. Hopefully we will implement their game using pgzero library instead.
- Some pgzero games that we will probably use are
The worksheets are written in LaTeX, typeset using luaLaTeX due to extra fonts, using the document class coderdojo.cls.