Making Use of Pseudocode

Marcus Ansley
2 min readMar 22, 2021

--

I think the best way I can describe it is that pseudocode can be an incredibly quick and easy way of noting the steps and logic needed for your script to work. You can jot down, for instance, what variables you’ll need, how and where they’re going to change, as well as the order of those operations. Even if you don’t know exactly how to implement or achieve these just yet, you’ve essentially created a short roadmap for what you need to research and experiment with in order to reach your end goal (be that, for instance, moving the player, destroying something on collision, checking a condition and responding accordingly, etc.).

I’m sure you can briefly jot down the name of the method(s) you’re intending to use to achieve this, but the emphasis should ultimately be in the overview/broader picture rather than the details. Because the implementation and problem-solving side of things can get pretty messy pretty quickly, and it’s very easy to lose sight of where exactly you are in your code and what exactly you set out to achieve with these statements.

It can also be handy on different levels. For instance, you can plan out logic at a micro level:

// Generate random number. 
// Select from list using random number.
// return this object.

As well as on a macro level with, say, a Game Manger script:

// Set game to default values
// Load in desired location (based on scriptable object?)
// Pass on location details to other scripts (location display, feedback manager, etc.)
// Begin StartGame Coroutine (and run game)

You’ll likely want to clear away this pseudocode once you’re happy with your implementation, as a rule of thumb for comments is to only leave comments for things which aren’t especially apparent from reading the code itself. These comments are here primarily for the planning stage and to help keep you on track during the implementation stage.

--

--

Marcus Ansley
Marcus Ansley

Written by Marcus Ansley

Game Developer | Game Design and Literature Graduate

No responses yet