How computer code like Python, Lua and C-sharp is used to create online and video games

Published: 
Sponsored Post
Listen to this article

To make your own games, you need to give the computer easy instructions to follow in a language it can understand – code

Sponsored Post
Young Post |
Published: 
Comment

Latest Articles

Hong Kong’s LGBTQ community faces persistent mental health challenges

Jose Mujica, former Uruguay president and leftist icon, dies at 89

Submit your application for Young Post’s 2025 summer internship programme!

190 teams set to race in Hong Kong’s biggest dragon boat event since 2019

Nepal activists tackle pad pollution and challenge traditional menstruation views

Think of code as a language that you can use to instruct a computer how to design your game. Photo: Shutterstock

Ever wondered how games like Brookhaven or Among Us hook millions of teens worldwide? Behind the laughter, suspense, and virtual worlds lies a universal language: code. But here’s the twist—coding isn’t about complexity. It’s about breaking big ideas into tiny, clear instructions that even a computer can understand.

Game-making isn’t just for tech pros - anyone can jump in, even secondary students like you! Free tools like Unity, Python with Pygame, and Roblox Studio, used in classrooms everywhere, allow players to learn coding by building their own games.

Let’s check out how these work, peek at some hot games loved by many around the globe, and see how coding can turn ideas into epic adventures.

Archiving old-school video games can help preserve Hong Kong culture, says founder of local retrogaming group

Coding tells the game what to do

Coding is like telling a computer what to do, and in games, it’s how you make stuff happen. Imagine code as a conversation between the creator and the game. Every line is a simple command, like teaching a friend the rules of tag. These instructions define how the game works, like how players move and interact with objects.

For instance, code might say: “When someone touches this door, move them to the rooftop.” Another example could be: “If players interact with an object, this teleports them to the last time they interact with it.”

In many popular games, including those made in Roblox Studio, developers use a language called Lua to write these instructions.

Another language used in games is C-sharp – this is used to create the popular game, Among Us, where players hunt for impostors.

In the game, pressing the spacebar on your keyboard triggers an emergency meeting. The game checks: “Did the player press the spacebar? If yes, start the meeting.” These aren’t cryptic formulas; they’re straightforward commands. Coding, at its core, is about precision: telling the game what to do, when to do it, and how.

“Among Us” was developed using C-sharp – or C# – coding language. Photo: Shutterstock

Where can I make my own games?

Roblox Studio, Pygame and Unity are platforms where you can create your own games as long as you write precise instructions.

Unity is the platform that Among Us was built on. You can use Unity’s tools to help you create games where you make the rules – for example, a thrilling treasure hunt game only ends once a player snags every coin.

Pygame uses the programming language, Python. Imagine making a mini-game where characters face off. Using Pygame, you can draw shapes – like a triangle for a battle arena. Then, upload a character image and resize it to fit your arena. Then, give the computer clear steps: tell the computer to show your character and move it with arrow keys – then you’ve got a battle going!

Source: PST

Developers start small, like making a character dodge obstacles. Then, they keep adjusting and improving until the game is fun to play.

When a game runs slowly, developers simplify their instructions to reduce strain on the game, or see if other adjustments are needed. For example, when Among Us glitches during a meeting, developers don’t panic. Instead, they ask: “Is the ‘start meeting’ command happening too soon? Let’s add a delay.”

Every bug is a puzzle, and every fix sharpens both the game and the coder’s skills.

Games aren’t built in a day; they’re crafted line by line and are fixed mistake by mistake. So grab Roblox Studio, Python or Unity, break your idea into bite-sized commands, and let the screen come alive. After all, every epic game begins with two words: “What if …?”

At PST, we make technology education accessible and fun for learners of all ages. Our mission is to ignite a passion for technology, empowering them to confidently navigate the digital landscape.
Sign up for the YP Teachers Newsletter
Get updates for teachers sent directly to your inbox
By registering, you agree to our T&C and Privacy Policy
Comment