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

JoC #9: Snakes on a plane!

      Satisfaction lies in the effort, not in the attainment; full effort is full victory.
            — Mahatma Gandhi

Things are start to heat up in our scenario: Snakes are chasing Trick (the turtle) over the plane. (That’s, of course, ‘plane’ as in ‘flat bit of ground’, not as in ‘flying thing’).

Download video

Concepts discussedHmm, don’t know. Creating yet another class. Copy-and-paste coding – is that a concept?

JoC #8: Keeping your code clean

      Always code as if the guy who ends up maintaining your code will
      be a violent psychopath who knows where you live.
          — John F. Woods

Here it is: The Joy of Code, Episode 8.

This time: housekeeping. No new functionality, but good coding practice. Enjoy.

Download video

Below is a version of the scenario to download as it is so far (at the end of this episode). If you haven’t been coding along with the previous episodes, but want to start here, use this version.

Concepts discusseddefining methods, code quality

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

JoC #7: Lettuce is good for you!

      The person who knows HOW will always have a job, but the person
      who knows WHY will always be his/her boss.
          — Anonymous

Trying a different presentation style for a change (in an attempt to speed things up a bit), today we’ll do a quick run through first, followed by some explanation.

And what we’re doing is giving our turtle something to eat. Have a look.

Download video

Concepts discussed: creating a new class, if statement, collision detection, saving the world (yes, really.)

JoC #6: Adding random behaviour

    The solution of every problem is another problem.
          — Goethe

Setting off on our path to create a little computer game, today we look into random behaviour. Random events are, of course, very important for games. If everything were entirely predictable, many games would be boring.

So, sit back and watch to see how we get Trick the Turtle to stagger around randomly.

Download video

And now do it yourself!

Concepts discussedif statement, random numbers, Greenfoot API documentation

JoC, Teacher Commentary 5: Early coding examples

    ‘When I use a word,’ Humpty Dumpty said, in rather a scornful tone,
    ‘it means just what I choose it to mean — neither more nor less.’

    ‘The question is,’ said Alice, ‘whether you can make words mean so
    many different things.’

    ‘The question is,’ said Humpty Dumpty, ‘which is to be master — that’s all.’

        — Lewis Carroll, Through The Looking Glass

 

Welcome back to the teachers out there. Here are a few remarks about Episodes 4 and 5 of the Joy of Code series.

If you have any questions or comments, let me know in the comments section here on the blog, and I will respond to them in the next episode of the teacher commentary.

Download video

 

JoC #5: If statements

    The sooner you fall behind, the more time you’ll have to catch up.
        — (unknown)

Continuing straight on from the last episode, we now make the turtle turn at the edge of the world.

Download video

Concepts discussed: method return value, boolean, if statement

Nothing to download – we continue with the scenario from last time.

 

JoC #4: Finally – some code!

    Good things, when short, are twice as good.
        — Gracián 

Yes, finally we’re getting into some coding!

Download the brand-new trick-the-turtle scenario (below), watch today’s episode, and then have a go yourself!

Download video

Concepts discussedmethod call, parameter, method definition

Scenario download: trick-the-turtle-v1.zip    (save and unzip before opening)

JoC, Teacher Commentary 3: Objects and classes

    Treat people as if they were what they ought to be, and you help them to become
    what they are capable of becoming.
            — Goethe

So, here we go, the first instalment of a Teacher Commentary.

If, you may ask, this is the first one, why then is it called “Teacher Commentary 3”?

Fair question, but there is method in this madness. I have decided to number them not sequentially, but in sync with the main Joy of Code episodes. Each Teacher Commentary will get the number of the episode it refers to. Since this commentary talks about episode 3, it is Teacher Commentary 3 (or TC-3, as I will soon start to call them in the headings).

Sometimes the teacher commentaries may not be tightly associated with an episode, but they will still fit in somewhere in the sequence, so they will get whatever number we’re up to in the main episode sequence.

One more rhetorical question before we get to the video: What is a “teacher commentary”?

The TC videos are meant for people who are not only concerned with learning object-oriented programming, or Greenfoot, or Java, but with teaching it. It talks to you as a teacher.

If you are not a teacher, you’re of course welcome to look at it as well, but I’m not sure how interesting this will be for you. Maybe your time is better spent moving on to the next main episode. (You won’t miss anything important.) Your choice.

Download video

 

JoC #3: Classes and objects

    If a man writes a book, let him set down only what he knows.
    I have guesses enough of my own.

          — Goethe

Alright, now it finally starts getting interesting! After the previous talk about installation, now we’re getting started actually doing stuff.

Watch this episode to get the first feel for working with Greenfoot, and see what classes and objects are all about.

Download video

Concepts discussed: class, object, method, instance, return value, return type, void, int, boolean

And, as I said in the video: Follow @JoyOfCode on Twitter to get updates when new episodes are posted.

Scenario download for this episode: hedgehogs.zip      (save and unzip before opening)