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

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

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.

Orange background

Try Our AI Features

Explore what Daily8 AI can do for you:

Comments

No comments yet...

Related Articles

OpenAI says ChatGPT taking on Google by offering AI searches for products
OpenAI says ChatGPT taking on Google by offering AI searches for products

South China Morning Post

time29-04-2025

  • South China Morning Post

OpenAI says ChatGPT taking on Google by offering AI searches for products

OpenAI has announced that ChatGPT is now helping users find products online, enhancing its challenge to Google amid regulatory pressure on the search giant's market dominance. Advertisement The new shopping capability further blurs the line between AI chatbots and search engines, signalling OpenAI's ambition to compete with Google in a market the latter has controlled for decades. 'Search has become one of our most popular and fastest growing features, with over a billion web searches just in the past week,' the San Francisco-based company said in a post on X. The update allows shoppers to find and compare items through natural conversation, then connect directly to merchants for purchases. Google, under pressure from a US antitrust court case, is facing competition from ChatGPT, which handled a billion searches in a week. Photo: Shutterstock 'Instead of scrolling through pages of results, you can simply start a conversation,' OpenAI's post said, adding that users could also ask follow-up questions or compare products.

How truffles are revolutionising skincare: from the court of Catherine de' Medici to Netflix's dating show Single's Inferno, the culinary delicacy is now coveted for its anti-ageing properties
How truffles are revolutionising skincare: from the court of Catherine de' Medici to Netflix's dating show Single's Inferno, the culinary delicacy is now coveted for its anti-ageing properties

South China Morning Post

time24-04-2025

  • South China Morning Post

How truffles are revolutionising skincare: from the court of Catherine de' Medici to Netflix's dating show Single's Inferno, the culinary delicacy is now coveted for its anti-ageing properties

For thousands of years, gourmands have sought out truffles – considered a food of the gods – for their rich fragrance and woody flavour. Culinary use of the ingredient, which is technically the fruiting body of subterranean fungi, was documented in ancient Roman texts by Pliny the Elder, it was beloved by the Etruscans before that. Centuries later during the Renaissance, Italian noblewoman turned French queen Catherine de' Medici brought the white truffle to the French court. And in 1954, Marilyn Monroe reportedly requested truffles for her and Joe DiMaggio's wedding meal. White truffles are lauded for their hydrating, brightening, firming and soothing properties. Photo: Shutterstock Advertisement While we may now be accustomed to splurging on indulgent truffle-capped pasta dishes and snacking on addictive French fries sprinkled with truffle salt, the prized fungi is also moving from menus to our vanity tables. Eagle-eyed viewers of the Netflix dating show Single's Inferno may have glimpsed a spray bottle on the contestants' vanities; even more beauty fans have seen it used in one of the many K-beauty tutorials touting the product, d'Alba's First Spray Serum, as a must-have. Seen in K-beauty tutorials – d'Alba's First Spray Serum. Photo: Handout The viral formula, developed to be misted on clean skin, as well as during and over make-up for a hydrated, luminous complexion, is infused with white truffle sourced from truffle mecca Alba, in Piedmont, Italy. It's a serum, setting spray and refreshing mist all in one, with TikTok users and make-up artists alike applauding the dewy, radiant finish it gives. In fact, d'Alba's entire offering – from its hit spray serum and treatment face masks, to another fan favourite, the Double Serum & Cream – revolves around the prized ingredient. The brand cites white truffle as containing large amounts of vitamins C and B12 (beloved for their effectiveness at preventing hyperpigmentation, or fading it if it has already occurred), as well as key minerals and amino acids for anti-ageing benefits like improved skin elasticity. Elsewhere, the fungus is lauded for its hydrating, brightening, firming and soothing properties. Black truffles, on the other hand, more subtly flavoured than their white counterparts, are used in skin and haircare products for their moisturising benefits, as well as anti-inflammatory properties that can improve the likes of acne, eczema and rosacea. They may not look special, but black truffles have excellent moisturising and anti-inflammatory properties.

Why actors and models who licence their images to AI marketing firms may come to regret it
Why actors and models who licence their images to AI marketing firms may come to regret it

South China Morning Post

time18-04-2025

  • South China Morning Post

Why actors and models who licence their images to AI marketing firms may come to regret it

South Korean actor Simon Lee was stunned when he saw his likeness – at times as a gynaecologist or a surgeon – being used to promote questionable health cures on TikTok and Instagram. Advertisement He is one of scores of people who licensed their image to AI marketing companies and then ended up with the unpleasant surprise of seeing themselves featured in deepfakes, dubious adverts or even political propaganda. 'If it was a nice advertisement, it would've been fine to me. But obviously it is such a scam,' he says, adding that the terms of his contract prevented him from getting the videos removed. The result left him with his digital clone advocating lemon balm tea to lose weight or ice baths to fight acne The method for making avatars involves actors displaying a range of emotions in front of a green screen. From this, AI can make avatars that can say all sorts of things in different languages. Photo: Shutterstock AI technology – cheaper than filming actors but more realistic than an entirely AI-generated avatar – allows firms to build catalogues of digital models to appear in videos that mostly promote products or services.

DOWNLOAD THE APP

Get Started Now: Download the App

Ready to dive into the world of global news and events? Download our app today from your preferred app store and start exploring.
app-storeplay-store