We covered a lot of ground today in the Python Games stream . We looked at variables including strings, math operators, inputs and outputs, while loops and if statements. The code from our number guessing game along with some of the code snippets from today are available here.
Ninjas can read the first few chapters of Invent Your Own Computer Games with Python as they deal with the same concepts.
Next week we will run through what we have covered so far, do more work on improving our number guessing game and if we have time, start working on a text based adventure game. Here are my slides fron today’s session python2014_session1.
Category Archives: Bodgers
Python Beginners – Driving Game
This week we looked at code for the bare bones of a race car game.
We started off by just moving a block around the screen and then rotating it. Then we figured out how to drive it around the screen.
Finally, we looked at how to give the impression of movement to our car sprite by scrolling the track around behind it.
For next week I want the Python group to look at Scratch Beginners week 2 and week 3 as we are going to attempt the same thing in Pygame.
You can find our code from this week here.
Python Beginners – Space Defender
Today in the Python group we looked at how a few simple changes can change the look and feel of a game. Our space Defender game uses code recycled from last weeks Bunnies And Badgers game combined with a few new sprites to make a completely new game. We also looked at how to use Geometry when moving sprites around the screen.
movex=math.cos(angle_z)*10
movey=math.sin(angle_z)*10
xpos+=movex
ypos-=movey
The above code calculates how many pixels the x and y coordinates of our sprite needs to be changed for it to move 10 pixels in the direction of angle_z. You can learn more about Sin and Cos here.
Python Beginners – Bunnies and Badgers
Sorry for being a little late putting this up. This week in the Python group we worked on an online tutorial which is available at Beginning Game Programming for Teens with Python. If you copy the folder Bunnies_and_Badgers from Dropbox here onto your own computer it will make getting started a little bit easier.
Python Beginners- Getting started with Pygame
Today the Python group started to experiment with Pygame.
Pygame is a software library that has modules for graphics, sound, and other features that games commonly use.
We looked at two programes from “Invent Your Own Computer Games with Python” by Al Sweigart which are available here.
Next week we will go through the code line by line.
Python Beginners- Week 7: for loops and more X Factor
Today we continued looking at some more new topics in Al Sweigart’s Hangman game http://inventwithpython.com/chapter9.html. Next week we will be looking at the game itself. The source code from today’s code snippets are here https://www.dropbox.com/sh/nlqaivbro7r5m9a/iRYEIa6Cti. Here are today’s slides.python session7
Python Beginners- Week 6: Lists
Today the Python group began looking at the Hangman Game from Invent Your Own Computer Games with Python (http://inventwithpython.com/chapter9.html). There are many new concepts in this game so we are going to spend the next few weeks looking at these.
We looked at Lists which are a way of storing a number of values in one variable. We had some fun writing code snippets mainly based around X-Factor. They are available here https://www.dropbox.com/sh/ax43g3recnn02p6/Cat_QexogU
We looked at some new ways of working with strings such as multi-line strings. We also learned about new types of functions called methods.
Next week we will be looking at a new type of loop called a for loop.
Here are my slides from today. python session6
Python Beginners – Week 3: Functions
This week the Python group looked at Functions, Escape Characters and Boolean Operators. We also started to rewrite the Dragon’s Realm game which we will continue with after the break. Don’t forget to look at chapters 5 and 6 of “Invent Your Own Computer Games with Python” http://inventwithpython.com/chapter5.html . Here are my slides from today- python session3
Python Beginners-Week 1
We had a slow start to the Python session due to Wi-Fi and installation issues. However once we got moving we managed to cover variables including strings, math operators and inputs and outputs.
Ninjas are encouraged to read the first three chapters of Invent Your Own Computer Games with Python by Al Sweigart, which is available at http://inventwithpython.com/chapters/ .
Next week we will be looking at loops and decisions in a number guessing game and comparing it to a similar scratch program.

Here are my slides from Week-1
session1slides

