Skip to content


JoC #30: Introduction to loops

      Whatever begins, also ends.
            — Seneca
      (Seneca obviously didn’t know about getting your loop condition wrong …  — mik)

Today, we are introducing a new concept: loops. Or, if you want to know more precisely: the while loop.

But, as always, we’re not doing this by just talking about the theory in a vacuum – we actually need it to progress with one of our projects, the Breakout game that we have seen before.

Loops are a concept fundamental to all programming, so if you are a learner, pay close attention. You will need this again later!

Download video

Concepts discussedloops, while loop

Download: breakout-v4.zip

Report post

Posted in Greenfoot, Joy Of Code.

Tagged with , .


JoC #29: Viewer questions: timers

      Time is an illusion. Lunchtime doubly so.
            — Douglas Adams

We are starting a new, probably more or less regular, thing today: answering viewer questions.

In the first of the Q&A episodes, I am talking about timers: How to arrange something to happen after a specific time delay. This principle is generally useful for many games and simulations. We also get  bit more practice with int variables.

Download video

Concepts discussedtime delay, variables, counting


Report post

Posted in Greenfoot, Joy Of Code.

Tagged with , , .


JoC #28: Return of the object interaction

      If life gives you lemons – keep them. Because, hey. Free lemons.
            — Anonymous

In this episode, we’re continuing from the last episode’s theme and investigate and compare an alternative structure for making our Ball and Counter objects cooperate. We also have a first brief look at casting.

Recognising alternatives is a good skill, and it slowly eases us into discussions about code quality, which we will get to in more detail later.

Download video

The download today (below) is the scenario as it is at the end of this episode. However, try to add a counter into one of your own scenarios to make sure you are fully taking in what’s going on here.

Concepts discussedobject interaction, casting, score counting

Download: breakout-v3.zip  (the scenario at the end of this episode)

Report post

Posted in Greenfoot, Joy Of Code.

Tagged with , .


JoC #27: Object interaction – a second look

      Daring ideas are like chessmen moved forward; they may be beaten,
      but they may start a winning game.
            — Goethe

In this and the next episode, we’re looking a bit more into how to set up object structures, and how to get them to interact. This is one of the most fundamental concepts of object-oriented programming, so you need to get your head around this.

We discuss this here with the example of integrating our counter object into a scenario.

Download video

Concepts discussedobject interaction, object references, score counting, constructors, fields

Download: breakout-v2.zip  (the scenario at the end of this episode)

Report post

Posted in Greenfoot, Joy Of Code.

Tagged with , .


JoC #26: How to display text

      Teamwork is essential; it allows you to blame someone else.
            — Finagles’ 8th Rule 

One of the frequently asked questions is how to display text in Greenfoot scenarios. Today I’ll answer that question.

I discuss two things: How to display some static text (text that does not change, such as instructions), and how to display text that should change during the program run. We’ll do that by making our own score counter.

Download video

Concepts discussedDynamic images, text display, GreenfootImage, score counting

Report post

Posted in Greenfoot, Joy Of Code.

Tagged with , .




Protected by Akismet. Blog with WordPress.
The views expressed in this blog are not necessarily those of the University of Kent. Conditions of Use and Guidelines | blogs.kent