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.
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.
If can keep your head when all about you are losing theirs it’s just possible you haven’t grasped the situation. — Jean Kerr
Today, we’ve got some background stuff to discuss. Not much happening in terms of new functionality to our project, but important (and, no doubt, incredibly interesting) conceptual information.
Why is there sometimes a classname before a method call and sometimes a variable?
I’m sure all of us have had sleepless nights where we’ve been lying awake pondering this question. Today, it shall be answered!
Even if you’re not that interested in discussion of underlying concepts, but just want to GET STUFF DONE — still, watch this video. You can only become a good programmer (and get stuff done) if you understand what you’re doing.
I really want you not only to copy what I’m showing you, but become able to invent and create your own programs. For this, it’s important to get the concepts.
So, hit start, sit back for a few minutes, and learn something!
If you have passion and focus, you can achieve things that amaze yourself.
And we’re back! I hope you used your couple of weeks space between Joy of Code episodes to catch up and get a bit of practice with Greenfoot — and now we’re off again.
This time, we’re talking about dealing with mouse input. Very important for many games and other interactive programs.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. — Brian W. Kernighan.
We’re leaving the ‘Trick, the turtle’ scenario this week to make something new completely from scratch.
The main purpose here is to piece together everything we have seen to far about the structure of a class, and create a complete new class (with fields, constructors and methods).
Yes, I know, this doesn’t sound too exciting. I can see from the video view numbers that videos dealing with review of concepts aren’t quite as popular as the ones showing new stuff.
So: Don’t worry. I’ve thrown a few interesting new things in as well: dynamically changing images, string concatenation and multiple constructors are some of them. Oh yes, and a first run-in with a runtime exception!
Habe Mut, dich deines eigenen Verstandes zu bedienen. — Immanuel Kant
Welcome back after a little break in putting out new episodes.
I was at a conference for a week or so (Melbourne, other side of the world!), and then I had to get settled into my time zone again, but I’m back! I still feel a little jet-lagged, so if my voice sounds even more drab than usual in this episode – I blame the time zones.
This episode deals with an incredibly important concept: object interaction. (It could actually also have been titled “Object interaction – a second look”.) We started to look at object interaction a little bit in Episode #15, and now we’re really getting stuck in. We’re throwing around terms like “object references” and “constructors”.
Yes, we’re slowly cranking up to a more professional level here. So sit back, switch your brain on, and watch. And of course — as always — after watching: Fire up Greenfoot, and get coding yourself!
Oh, and one more thing: I am showing how to implement a score counter here, because several people have asked me how to do that. So if you have a question, or something you want explained: tell me in the comments, and I’ll try to fit it in in one of the future episodes.
Update: This episode shows how to use a ready-made counter object. If you are interested in making such a counter yourself, you can now look at Episode 26.
The pure and simple truth is rarely pure and never simple. — Oscar Wilde
Today a long, and quite full episode. We encounter various very important concepts for the first time: local variables, class types and object interaction.
If you have questions left after watching this – don’t worry. We will look at all of this again in more detail in future episodes. And you can use the comments below to ask your questions (or make any other comments).
By the way, I just noticed I made a mistake. (Yes, that does happen!) There is a bug in the program that I’m writing in this episode. Can you spot it?
We know accurately only when we know little; with knowledge doubt increases. — Goethe
It’s time to pause a little bit with our code writing and analyse what we have so far. We want to make sure that we properly understand what’s going on.
So, today you’ll get a deeper understanding of code structure and – as a bonus – find out a bit about comments.