Teaching My Daughter To Code, Part III: Prepare The TARDIS!

The third part of my endeavours to write a Dr Who computer game with my daughter

If you’re reading this, then you probably already have an idea what this is about: An ongoing project to write a Dr Who-themed computer game with my daughter Sophie, who is 10 years old. (Yes, she’s 10 now – it was her birthday earlier this week!)

This is the third part of this story. In part I we got the Doctor to move, and in part II we added some Daleks. This time, we giving the Doctor something to do, something worthy of the last of the Time Lords: Collecting energy pellets for the TARDIS.

Continue reading

Teaching My Daughter To Code, Part II: Invasion of the Daleks

Second part of my endeavours to write a computer game with my daughter

A few days ago, I have written about starting to teach my daughter some programming by inventing and implementing a game with Greenfoot and Java. Here’s the second part of that journey.

This time, I had thought a little more in advance about what might be a good thing to tackle next. Putting floors in, so that the Doctor would just walk on those levels (and ladders to go up and down)? Or other moves: jumping, ducking, etc?

I decided the most interesting thing would be to put some opponents in – other actors that you could run away from, and who could catch you. With the Doctor, it’s pretty obvious who that should be: the Daleks! (They are the Doctor’s prime enemy, after all.)

When I came home from work, I suggested this to Sophie. Happily, she agreed.

Continue reading

Teaching My Daughter To Code

First party of a journey of writing a Doctor Who video game in Java with my 9-year-old daughter.

Update: Part II, Part III and Part IV of this story are available now.

(Note: This post is more than 10 years old. Some of the Greenfoot code shown can be written more easily in newer versions of Greenfoot, using newer API methods.)

Yesterday, my daughter Sophie asked me to show her how to write a computer game. She is nine. (Well, only a few weeks away from being ten – at this age, a year still matters.) She has never written any code before. Now, there’s a challenge, if I ever saw one.

I am a computer scientist, and one of our projects is Greenfoot – a programming environment designed to teach kids (and older students) to code with Java. So far, that has all been part of my research work. Research into programming education, tool design, etc. I have used Greenfoot with kids (mostly about 15 years old), but more often I do presentations and workshops for teachers.

I have often wondered how low in age you could take Greenfoot. It’s Java, after all, not Logo. 15-year-olds clearly works. But 10 year olds? We don’t know.

So I told Sophie that we’d start making a game tomorrow. That was yesterday. So today was the day. Afterwards, I thought it might be interesting to try to record the process we’re going through — see what happens.

So here is my (hopefully continuing) diary of coding with my daughter… (Our results, live demo and source code, are at the bottom.)

Continue reading

Back to basics – new Greenfoot video

Recently, I have announced the first Greenfoot tutorial video. Not an overwhelming success as yet (no nominations for Academy Awards or Emmys, no calls from Warner Bros. or the BBC). As far as I know, maybe not even a viewer yet… Alas, I shall not be discouraged. If nothing else, it gives me somthing to look back on in a few years and laugh at how funny my voice sounded…

The idea with these videos is to provide random tips and techniques of doing various things in Greenfoot. However, equally random as the choice of subject for these videos is my order of producing them: I started with “Making explosions” – a rather advanced tip for blowing things up. Not really the first thing you need to know when getting started with Greenfoot.

The idea is, over time, to build up a collection of short tutorials that cover a broad range, from basic tips to more sophisticated techniques. The order in which they will appear will, however, remain somewhat random. I record them according to whatever I happen to have on my mind at the time.

I realise, though, that the basics — getting started — is really what most people need to know right now. So I have recorded a first general introduction. Not really a programming tip, but a very quick overview of what Greenfoot is and what it can do for you. So if you are one of the great majority out there who haven’t got a clue what Greenfoot is, here’s a thing for you to look at and find out.

More to come in the near future.

Making explosions – a Greenfoot video demonstration

Explosion

Many of you probably know that I am working on the Greenfoot project. The software itself is in public release and is very usable. What is lacking at the moment is documentation – good instruction that tells people how to do things.
Creating this documentation will be one of our main tasks over the coming year or so. This will take various forms – web pages, a book, work sheets, examples, videos…

I have decided to make a start with some videos. They will be slightly random in order, showing things which I happen to have on my mind. Over time, though, I hope to build up a collection that is somewhat ordered: starting with basic tasks, and moving on to more sophisticated things.

So, here is the first batch: it shows you how to make a nice-looking explosion in Greenfoot. The video tutorial is sliced into three parts, just to keep the file size manageable.

The Greenfoot Video Tutorials

Making Explosions, Part I (length: ~5 min, 11.6 MB)
Making Explosions, Part II (length: ~18.5 min, 57.9 MB)
Making Explosions, Part III (length: ~15 min, 52.2 MB)

These are all published under the Creative Commons Attribution-NonCommercial license.

You can also get the source code of the project developed in the video.

Have fun. And let me know if you turn this into an interesting Greenfoot scenario!

More about Greenfoot sound

Asteroids-1

As the next Greenfoot release nears, and I mentioned sound support in my last post, there’s now a short demo video available. It shows smooth animation, and sound support in Greenfoot (in an “Asteroids” scenario).
Watch it here.

And come the next Greenfoot release, do it yourself!

And the best thing about it (or at least one of the best): this whole program is written with only about 280 lines of code (in Java)! Not too bad, I reckon.