Posts RSS Comments RSSTwitter 18 Posts and 28 Comments till now
This wordpress theme is downloaded from wordpress themes website.

PyWeek 11 – And the winner is …

PyWeek 11 has come to an end .  The judging is over and the winners have been announced.  The deserving winners are Universe Factory 11 as an individual entry with the game Mortimer the Lepidopterist and Super Effective 11 as a team entry with the game Trident Escape.

Mortimer the Lepidopterist

Trident Escape: The Dungeon of Destiny

Trident Escape: The Dungeon of Destiny

I made several interesting observations during the course of the contest.

Firstly, I’m no gamer, however that was clearly irrelevant to me as I thoroughly enjoyed the competition, the pressure of having to deliver a piece of software to a deadline (but not losing my job if I didn’t) and generally having free reign to hack with Python to produce a creative end product.  Not only that, but I was doing it in the knowledge that at least 39 teams of people would be playing with my creation.

Secondly, in telling my non-geek friends that I was entering this competition, I received all sorts of interest and support in what I was programming to a level I’d not experienced before.  It was both humbling and refreshing to be able to talk to my non-geek friends about what I was programming without a familiar glazed look descending on their faces.

Thirdly, I really enjoyed playing the other teams’ games and learnt a lot from doing so.  It was interesting to see the sheer variety of games and the creative thought that went into them.  It was also interesting to look at the code behind the games.  For me this was a real win and an affirmation that you learn most about coding from reading others’ code.

As mentioned previously, my entry was Voices Under Water and was written using the excellent pyglet and cocos2d libraries.  The game is based around a dolphin who has to catch life rings being thrown by a ship’s captain to save his crew from drowning.  It’s probably not the most exciting story, but I found myself writing the game then shoehorning the story onto it, and that was the best I could come up with!  Coming up with the name of the game was much easier.  My other half’s niece and her boyfriend are part of a band formerly called The Bacchae and more recently called Black Moth.  They kindly gave me permission to use one of their tracks which is fittingly called Voices Under Water as the backing music for the game.

Many thanks to the organisers and to the other teams for an enjoyable competition!

PyWeek 11

I’m currently involved in PyWeek, a game writing competition where entrants are given exactly one week to write a game from scratch in Python.  To be honest I’m not much of a gamer, but I couldn’t resist the creative challenge of writing a playable game in one week and I’m loving every minute of it.  As the front page of http://www.pyweek.org states:

The PyWeek challenge:

  1. Invites entrants to write a game in one week from scratch either as an individual or in a team,
  2. Is intended to be challenging and fun,
  3. Will hopefully increase the public body of game tools, code and expertise,
  4. Will let a lot of people actually finish a game, and
  5. May inspire new projects (with ready made teams!)

This is the eleventh iteration of PyWeek and the first one I’ve entered.  The theme for this iteration is the word ‘caught’.  My entry is called Superfly Funky Stuff though the game itself is really called Voices Under Water.  I’ll write more about what I’m coding in due course, but here’s a sneak preview:

Voices Under Water

And here’s a picture of my other half, Annie, recording splashing sounds in the bath for some DIY sound effects!

Why should kids be interested in programming?

My 10 year old nephew, Bob, loves computer games. In fact, I think it would be fair to say that most self respecting 10 year olds love computer games and wonder what else a computer is for apart from computer games, Facebook, Bebo, and the occasional use of that legacy communications medium called email.

My nephew, Bob!

There was a brief period in the 1980′s as the home PC revolution was picking up speed when we thought we would all have to learn how to program a computer. Computers were taking over the workplace and without this skill we would all be unemployable. That brief period ended with the rise of the office suite and the advent of email. For many jobs we’re now expected to have familiarity with word processors, spreadsheets, email and web browsing. You only really have to know how to program if you’re a programmer, whether hobbyist or professional, but that goes without saying. One could argue that the evolution of our technological society where programming is mainly restricted to dedicated programmers is a natural division of labour. Why should a secretary or an advertiser or a salesperson need to program? Why would a 10 year old need to program?

Bob can often be found discussing the merits of the computer games he plays and how they might be altered or improved. For example, earlier this week he described how he’d like to play a game which was a first person shooter where the enemy stood still and only fired back several seconds after being discovered. The game description was accompanied with much hand waving and shooting noises. There were further descriptions of the types of guns that should be available and when they should be made available to the player.

Bob’s vision of a new computer game was born from a creative process. What Bob needs now is a medium of creative expression to bring that vision to life. In the same way a musical instrument can be used to create an infinite variety of music, or a word processor can be used to create an infinite variety of novels, it is through programming that you can create an infinite variety of games, and programming is the medium of creative expression.

Michael Sparks asked the question: If you were 7 again, what would you expect to find in a book on beginning programming? Apart from the usual conditionals and loops (I can hear the writer of the fictional Functional Programming for 7 Year Olds groaning) it would make sense to fulfil our junior members of society’s primal need to play, adapt and create games.

Armed with the knowledge that learning to program was the path to learning to create computer games, Bob was all too happy to sit down with me and walk through some basic Python programming. We started with a simple quiz game. The first decision was to whether to choose Python 2 or Python 3. I figured that extensive library support wasn’t necessary for writing a quiz so I plumped for Python 3.  With Python 3, you also get to avoid being asked sticky questions such as:

Why is it called raw_input() and not input()?

…  and …

Why does raw_input() have brackets and print doesn’t?

The quiz went down very well and we got to touch on several Python constructs. Here’s a cut down version of what we wrote together:

score = 0

fvcolour = input('What is my favourite colour? ')
if fvcolour == 'red' or fvcolour == 'blue':
    print('Correct!')
    score = score + 1
else:
    print('Incorrect!')

sport = input('What is my favourite sport to watch? ')
if sport == 'football' or sport == 'Football':
    print('Correct!')
    score = score + 1
else:
    print('Incorrect!')

print('You scored', score, 'out of 2')

Bob was very excited by this.  He was particularly excited about the fact that he could get the computer to ask any question and respond to any answer in any way he wanted it to.  After helping him install Python 3 on his own computer and showing him how to use IDLE, he sat about creating more intriguing and inventive quizzes.

I was conscious of the fact that I only see Bob once in a while so I set about looking for an online tutorial he could follow.  I was also conscious of the fact that he really wanted to write games, specifically first person shooters with advanced sound and graphics!  A few weeks ago I attended the informative and entertaining tutorial Introduction To Game Programming given by Richard Jones at Europython.  Richard pointed us to Invent With Python, an online (and dead tree) book “written to be understandable by kids as young as 10 to 12 years old” teaching them how to program games using PyGame.  And it has been updated to Python 3.  Perfect.  Bob is busy working his way through the book and I can’t wait to play Bob’s first person shooter!

How would you introduce your 10 year old nephew / niece / daughter / son to programming?