JoC #32: Pretty pictures with while loops

      90% Rule of Project Schedules: “The first 90% of the task takes 90%
      of the time, and the last 10% takes the other 90%.”
            — (source unknown) 

One more time, discussions of loops.

Loops are such an important concept, and there are so many variations, that it is really important to get practice with them and get them properly into your head. To this end, we’re looking one more time at loops here before moving on to some new concepts in the next episode.

Today, we’re using a really important, fundamental loop pattern: A while loop with a simple loop counter. It looks like this:

    int i = 0;
    while (i < NUMBER)
    {
        doSomething();
        i = i + 1;
    }

Watch the video, and try to memorize this pattern. It will come in handy later!

Download video

Concepts discussedloops, while loop

Download (scenario as of beginning of this episode): breakout-v6.zip

JoC #21: Image manipulation – take two

      For every action, there is an equal and opposite criticism.
             — Steven Wright

We’re getting a bit further into image manipulation. I’ll show you how an actor can change appearance by dynamically changing its image while the program is running.

Download video

Concepts discussedimage manipulation, random numbers

Downloads: bounce.zip  bounce-v1.zip

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