Codecademy

Codecademy

Learning to program through books and tutorials is hardly an exciting endeavor. The first few exercises might maintain your interest by capitalizing on your staunch commitment to reach your goal of becoming an avid programmer, but interest often wanes as the exercises become more difficult and seem to drift further from real world applications. Enter Codecademy, an interactive game that teaches programming, right in the comfort of your own browser. Codecademy holds your hand through each step of the programming basics, including declaring your first variable and executing your first function. Explanations are concise and easy to understand, even for the absolute novice. You can follow the exercises at your own pace, and you can even experiment using the scratch pad, an in-browser Javascript editor that lets you play around with what you’ve learned. Best of all, Codecademy is built around basic game mechanics, including missions and achievements. Track and share your progress, and you’ll soon be on your way to programming your own website or game. Right now, Codecademy only offers Javascript courses, but it looks like they’re working hard to add more programming languages as soon as possible. So if you’ve always wanted learn how to code, give Codecademy a...
Error Terror

Error Terror

When deciding between using Unity or UDK as our game engine of choice, one of my main qualms was with the error messages Unity throws at you. Whereas UDK will let you jump in the game with multiple kismet errors, Unity spits out lists of errors, refusing to let you run the game before fixing them all. There are entire forums out there dedicated to dealing with various programming error messages. And as a novice programmer, this scared the heck out of me. How was I supposed to know what was wrong without seeing what my code did? However, after weeks of braving the sea of error messages, I’m happy to say that I find them quite helpful. Most of the time. In fact, I even have a few favorites: 1. Error CS8025: Parsing error This is hands-down my favorite. Easiest to fix, yet one of the most annoying. This error usually refers to a misplaced curly brace. Spend a few seconds visually pairing up all the curly braces, and this error is soon out of your hair. 2. Error CS1525: Unexpected symbol ‘{‘ This one is another fun syntax error, usually thrown out as a result of not pairing all the parentheses in conditionals. In programming, most things need partners. 3. Error CS0029: Cannot implicitly convert type ‘int’ to ‘bool’ There are several variations on this error, which usually results from syntax error in the conditional. Most of the time, I get this error when I forget to include double equal signs in my conditionals (e.g., ‘if (iLevel = 1)’ rather than ‘if (iLevel ==1)’), so the statement...
Working Smart > Working Hard

Working Smart > Working Hard

To say I’ve learned a lot about scripting over the past several weeks is an understatement. I’ve gone from struggling to create basic character movement to creating functions that can “think” on their own. But most of all, I’ve learned that programming is not just about working hard, but more importantly, about working smart. One of my recent tasks has been to design and implement a level select map. After plotting the levels on the map, my first instinct was to script the individual events for each level. So, for example, if level 3 was just completed, the spotlight for the next level would need to go on the level 4 marker. If Chip is on the raft between levels 3 and 4, he can go to the right for level 4, get back on the raft and go left for the bonus level, or get on the raft and go up to get back to level 3. But he would not be able to go past level 4. As you can imagine, the list of conditionals and events needed for each spot quickly grew quite lengthy. The solution? Work smart. I stepped back and analyzed the commonalities amongst the different stopping points on the map. Chip would need to stop at level markers, but also rafts and corners as well. But he would only be able to launch into a level while currently standing on a level marker. As the patterns started to emerge, I was able to formulate functions and algorithms so the code would work for me, rather than the other way around. It didn’t come without...
Unity

Unity

Learning a new program can be both exciting and stressful. For our final game project, we’ve decided to use the Unity game development engine. Unity allows us the flexibility to use prefabs and object oriented programming that will be especially useful for the mechanics in our game. While programming logic is easily transferrable from one programming language to another, the nuances and syntax can take a bit to get used to. Here’s one developer’s account of getting started with Unity:...
Good Code

Good Code

Did you know that the first software bug was an actual insect? Indeed, in 1947, Grace Hopper found a moth trapped in a relay of the Mark II at the computation laboratory at Harvard. And people have been debugging ever since. As we prepare for our final game projects, one plan we must prepare is a testing plan, complete with an estimate of the total number of bugs in our game. Wait a minute. Estimate the number of bugs before the code has been written? Seems like a prophecy waiting to be fulfilled. Why not just write code that’s bug-free? While this did occur to me, I imagine that most seasoned programmers would laugh in my face. Programming is a combination of trial and error, critical thinking, and on-the-fly problem solving. Throw in some time constraints, changing requirements, and evolving ideas, and things are bound to get hairy pretty quickly. I guess all I can do is brace myself and code...