Learning To Code

Monday, March 14, 2016

Filament Games

Executing Your First Code

Deciding which programming language to learn is often the most difficult decisions to make. C++? Java? Dogescript? Learning to program is 90% about the principles and 10% about the languages, so don’t stress about which one you choose.

Granted, there are languages that are more difficult to learn than others. While something like C++ is ultimately where your journey will take you, it’s also well known for its steep learning curve. Beginners often find that Python is more intuitive and paired with the great crash course over at Codecademy, you’ll be writing your first hello world program in minutes! The best part about Codecademy is that you can write code directly in your browser without having to install and setup any software. Once you’ve completed all the courses at Codecademy I recommend reading "Automate Boring Stuff With Python" which gives a more indepth look at programming in Python.

Adding Complexity

Now that you’ve taken these first steps, you’ve probably got a few projects under your belt - perhaps you’ve even programmed an automated light display for Christmas. While I’m sure your neighbors will be jealous when the holidays roll around, let’s apply your new skillset to something a little more substantial - making games. The most important concept that you need to understand is the game loop which is the beating heart of every game you’ll ever play.

So, you’ll want to grab Pygame which is a set of modules that will make writing games with Python easier. There’s a bunch of great tutorials on the website, but I recommend reading "Program Arcade Games" first. Once you start working on your first game, don’t make the common mistake of creating that complex role playing game you’ve been dreaming about for years; you won’t finish it. Instead begin with clones of classic games like Pong or Missile Command.


From there, just keep making games because as they say, practice makes perfect. You’ll start lots of projects that won’t even make it past a simple prototype. The important thing is that you’re gaining experience - one project may require path finding with A* and another may need an undo system. These little nuggets of information get added to your programmer’s tool belt and ultimately make you a better programmer.

It’s important to understand that as a programmer you aren’t just writing code - you’re solving problems. It’s also not about just solving the problem, but finding the best way to do it. One method may be quick and easy to write, but is it the most elegant solution? Code organization and structure is crucial to becoming a successful programmer. Poorly designed code will not only make your job more difficult, but also create serious problems for your co-workers.

Honing Your Skills

If you need some inspiration, game jams are one of the best ways to churn out projects. Usually you’re given a theme and a time limit (typically 48 hours) to make a game from scratch. The details often vary from jam to jam, but the purpose remains the same - to make games among others that share your passion. You can often find game jams near you by asking around, but here are a few that I recommend checking out:

  • Global Game Jam is the world’s largest game jam and happens once every year. Participants gather at various locations around the world to watch a keynote where a secret theme is announced. Once the clock starts ticking everyone pitches ideas to each other in order to form teams.
  • Ludum Dare runs every April, August, and December. There are two components to Ludum Dare - the Compo and Jam. The Compo is “classic” Ludum Dare, which is done solo and has a strict set of rules. The Jam rules are more flexible and allow you to work with others. Unlike the Global Game Jam, you don’t have to meet your teammates at a physical location. Instead you can work from the comfort of your own home!
  • One Game a Month is a monthly event that has no rules. If you want to make a game, then you’re ready to go. The main benefit here is that you will have a community to provide feedback on your games as well as emotional support.

The topics I’ve covered here are just the tip of the iceberg. If you’re still hungry for knowledge, there is a huge collection of free ebooks available on Github.

This article was originally posted on the Filament Games blog