While we're not fans of Canadian Prime Minister Justin Trudeau (both from a political standpoint, and because of geopolitical tension), we are fans of initiatives such as code.org's Hour of Code, which is an annual event being held this week. Code.org is primarily focused on the United States, but, hey, Canada can join in, too.
So when Canada's prime minister makes...a game... of some sort... to promote the Hour of Code, well, the world pays attention, and Gamasutra writes a short article about it. (But they're silent when the prince of Koopa Kingdom makes games...)
|See the tweets for yourself here.|
Coding is easy, eh? The kids taught him, eh? CHECK OUT THE GAME HE MADE, EH? EH? EHHHH? (...I put all of those “eh”s in there BEFORE I realised I was talking about a Canadian, just saying.) Fine. I will.
Here are the rules of Justin Trudeau's hockey-themed ball-bounce game:
- At the beginning of the game, a hockey puck (ball) spawns and bounces towards you.
- You control a hockey stick with the right and left arrow keys. The stick moves at a constant velocity with no acceleration.
- If your stick hits the puck, the puck bounces off of it.
- If the puck hits a wall, it'll bounce off that.
- If the puck lands at the goal at the centre of the top of the playing field, you'll score a point and one new puck will spawn.
- If you miss a puck and it goes through the bottom of the playing field, your opponent (the SYSTEM) will get a point, and spawn two new pucks.
|Eventually, the screen will just be black, and I assume the game crashes at some point.|
It's inevitable that, eventually, you'll miss a puck. And once there are two, since your hockey stick can only be at one place at a time (and it's not the fastest thing), you'll miss another even if you tend to the other. Then they'll continually increase, and never lower in count. It's therefore inevitable you'll end up with a puck-ridden mess.
Of course, identifying bugs and glitches is a big part of game development, as is beta-testing. I'm sure Mr. Trudeau identified this problem, since it takes a matter of seconds for the problem to manifest itself. Identifying problems is one big part... and solving problems is another big part. Mr. Trudeau didn't bother to do that.
For most programmers, the bulk of the programming work happens when trying to fix things, rather than writing it for the first time! Any coding lesson plan that has you skip over that is not very complete.
One way to prevent a zillion pucks on the screen is to set a variable equal to the total number of pucks on the screen, and only have a new puck spawn if the total number of pucks on screen is less than whatever arbitrary threshold you choose.
|The totality of Justin Trudeau's code. Notice there's nothing controlling the total population of new balls.|
I surmise that the reason two pucks spawn upon missing is to punish you and increase the difficulty for failure. Trudeau created a very powerful and, quite frankly, unstoppable feedback loop, or slippery slope. Once you miss one puck, you might as well stop playing. That's not commendable game design. The game should get more difficult when you've proven to be SUCCESSFUL. Imagine if you're playing the game for the first time and just trying to get used to the controls, and you miss a puck... and suddenly they're multiplying like crazy.
That's not a good first impression for a player, so they probably won't play again. I only did to make this review.
Don't play it. Justin Trudeau's breakout game (is that what it even is? That's how Gamasutra described it, anyway) is a bad game, and not even fun. I think it's shameful that Trudeau blames the kids who taught him, and then has the hubris to declare that coding is easy while showing off this mess of a game. However, this experience is still a useful introductory lesson for new coders in what NOT to do, and that's important when learning!
KoopaTV.org is possibly just a fan of code.org because they share a top-level domain. Stay tuned this month for the release of KoopaTV's brand-new videogame, which the staffers are lazily beta-testing to ensure it doesn't have issues like Justin Trudeau's!
KoopaTV promoted the Hour of Code back in December 2013 through the lens of American bipartisan agreement and then neglected to mention it since.
Microsoft has teamed up with code.org with some Minecraft: Education Edition action.
KoopaTV's 2016 game, The Wonderful 1237, doesn't have Trudeau-level issues, at least. You can play it here!