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

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

JoC #20: Image manipulation – first contact

      What is important in life is life, and not the result of life.
            — Goethe

Today, we’re starting to look a little more at images. We’re starting with something quite easy: manipulating (programmatically) the world background. But this introduces important concepts which we will use shortly to do much more with images.

Also, this is another nice example of object interaction (as we know by now: one of the most important concepts in object -oriented programming). In this case, the world object interacts with an image object.

Download video

Concepts discussedimage manipulation