JoC #33: Playing Breakout! Collision detection

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

Today, we’re finally getting our breakout game into a playable state! Yes!!

See how to implement functionality to recognise when the ball hits a block, and make the block disappear. This is really the centrepiece of our program – from now on, everything else is detail.

Download video

Concepts discussedcollision detection, removing an object from the world

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

JoC #24: Smoke and mirrors

      The ideals which have lighted me on my way and time after time given me new 
      courage to face life cheerfully, have been Truth, Goodness, and Beauty. . . . The 
      ordinary objects of human endeavour — property, outward success, luxury — have
      always seemed to me contemptible.
            — Albert Einstein

One more quick one about image effects: a smoke effect to be precise. I’ll show you how to create this really cool effect just with what you know already. Hopefully, this will give you some ideas of more cool effects that you can do on your own.

Download video

Concepts discussedimage manipulation, visual effects, animation

Download: The project can be downloaded from the Greenfoot book website.

 

JoC #23: Animating the image

      A positive attitude may not solve all your problems,
      but it will annoy enough people to make it worth the effort.
            — attributed to Herman Oliver Albright

A last little bit before we leave our coloured circles behind: an animation. In this case, it’s a very simple one: fading out the circles. But it shows an important technique: The appearance of an actor can change all the time, if we want to. This is the basis for many visual effects.

And, we finally see an if-statement with an else clause! I can’t believe that it took this long for this to pop up.

Download video

Concepts discussedtransparency, dynamically changing images, if-statement


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 #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.