JoC #16: Adding a score counter

      Habe Mut, dich deines eigenen Verstandes zu bedienen.
            — Immanuel Kant

Welcome back after a little break in putting out new episodes.

I was at a conference for a week or so (Melbourne, other side of the world!), and then I had to get settled into my time zone again, but I’m back! I still feel a little jet-lagged, so if my voice sounds even more drab than usual in this episode – I blame the time zones.

This episode deals with an incredibly important concept: object interaction. (It could actually also have been titled “Object interaction – a second look”.) We started to look at object interaction a little bit in Episode #15, and now we’re really getting stuck in. We’re throwing around terms like “object references” and “constructors”.

Yes, we’re slowly cranking up to a more professional level here. So sit back, switch your brain on, and watch. And of course — as always — after watching: Fire up Greenfoot, and get coding yourself!

Download video

Oh, and one more thing: I am showing how to implement a score counter here, because several people have asked me how to do that. So if you have a question, or something you want explained: tell me in the comments, and I’ll try to fit it in in one of the future episodes.

Update: This episode shows how to use a ready-made counter object. If you are interested in making such a counter yourself, you can now look at Episode 26.

Concepts discussedobject interaction, constructor, field, local variable, assignment, external method call

Downloads:  trick-the-turtle-v4.zip

JoC #15: Object interaction (first encounter)

      The pure and simple truth is rarely pure and never simple.
            — Oscar Wilde

Today a long, and quite full episode. We encounter various very important concepts for the first time: local variables, class types and object interaction.

If you have questions left after watching this – don’t worry. We will look at all of this again in more detail in future episodes. And you can use the comments below to ask your questions (or make any other comments).

By the way, I just noticed I made a mistake. (Yes, that does happen!) There is a bug in the program that I’m writing in this episode. Can you spot it?

Download video

Concepts discussedvariable, field, local variable, assignment, class type, object interaction, external method call


JoC #14: A first look at variables

      I’m a great believer in luck, and I find the harder I work the more I have of it.
            — Thomas Jefferson

Let’s move on to another important concept: variables.

There’s a lot to say about variables, so we start with oner example: An int variable as a counter.

Download video

Concepts discussedvariable, field, int, ++


JoC #13: The structure of a class

      We know accurately only when we know little; with knowledge doubt increases.
            — Goethe

It’s time to pause a little bit with our code writing and analyse what we have so far. We want to make sure that we properly understand what’s going on.

So, today you’ll get a deeper understanding of code structure and – as a bonus – find out a bit about comments.

Download video

Concepts discussedclass structure, class header, comments

JoC, Teacher Commentary 10: Motivation and reflection

      You must be the change you wish to see in the world.
            — Mahatma Gandhi

After a few days’ pause, here’s another video. And it’s time for a teacher commentary again.

We’ve crammed in quite a bit of material over the last few episodes, and the question now is: Firstly, how do we keep motivation up? But more importantly, do the students actually understand what’s going on?

Some hints and tips what to look out for…

Download video

The Joy of Code: Now with video download

One interesting suggestion I received from a viewer out there about the Joy of Code video series is to make the videos downloadable, because YouTube is blocked in a number of schools.

That seems like an obviously good idea, so I’ve done that now. Under every Joy of Code video, you will now see a download link. (On some (most?) systems, just clicking the link plays the video in the browser, so right-click, and choose “Save Link As…” or the equivalent option in your browser.)

Another advantage of this is that you can play the video in its original resolution (without up- or down-scaling), which should give you good high-def clear text on screen.

JoC #10: It’s done: Play the game!

      Times are bad. Children no longer obey their parents, and everyone is writing a book.
            — Marcus Tullius Cicero

And now we’re getting to the point where you can actually control the turtle and play your game.

Download video

You can download the scenario source (as it is at the end of this episode) below. If you do: unzip first, and then open.

Concepts discussedKeyboard control, code completion, String type

Scenario download:  trick-the-turtle-v3.zip