Collision Detection Modes in Unity

Collision detection modes in Unity’s Rigidbody component

Update (14 August 2020): Looking for an article on the Interpolate property on Unity Rigidbodies? We’ve put one together recently, so have a look here.

It isn’t particularly difficult to set up physics-based movement for objects in Unity — simply add a Rigidbody component onto an object that has a Collider component, and you’ll have yourself an object that moves and collides realistically with other objects.

Discrete collision
This was set up in 10 minutes.

If you start having fast-moving objects however, you might start to see these objects tunnel through obstacles.

Discrete collision tunnelling
Just like quantum physics. Sort of.
Continue reading
Coding your projectile arc

Coding projectiles for your tower defense game — Part 2

This article is a part of the series:
Coding projectiles for your tower defense

In the second part of this series, we will be exploring how to give our projectiles a nice vertical arc as they travel towards the target. This article will expand upon the work in Part 1, where we coded a projectile that could home in onto the target and detect collision with the target without using Unity’s physics engine’s.

Continue reading
Homing projectiles

Coding projectiles for your tower defense game

This article is a part of the series:
Coding projectiles for your tower defense

If you’re developing a tower defense game, one of the first questions you are going to be dealing with is this: how do you make the projectiles that your towers fire hit their targets? After all, these fired projectiles take time to reach their targets – targets that are constantly moving. Sometimes, by the time a projectile gets to where it was aiming at, their targets would’ve sometimes moved out of the way.

Continue reading

Content begins after the advertisement:


Image by Martin Vorel from https://stocksnap.io/photo/KLIK5Q5KX2
Image by Martin Vorel from https://stocksnap.io/photo/KLIK5Q5KX2

A primer on images for game developers

If your work involves sitting in front of a computer, chances are — at some point or another — you’ll have to work with digital images. For most people, it’s more than enough to know how to save images into the right formats. If you’re a game developer though, it’ll help to have a bit more in-depth knowledge, since you’ll be working with game engines that like to throw around obscure terms like true color, bit-depth or ARGB-16.

I struggled a lot with images during my early days in game development precisely because of these terms — Google searches and Wikipedia articles only led me to pages with big words that confused me even more. With time, I eventually figured things out — hence this primer. Hopefully, reading this means you won’t take as long as I did to figure things out.

Continue reading
Viking Harbour by Whiteoxygen
Art by Melcolm Lek

Making use of inheritance in game programming

A common problem I see in novice Unity game programmers is that they often create too much unnecessary, duplicate code. Take, for example, the programmer who creates a simple 2D platformer with a player character and a generic enemy character to be duplicated across the level. What often happens is that two separate scripts will be created — one for the player character, and one for a generic enemy character. Each individual script will define its own behaviours for things such as movement, jumping, dealing damage and receiving damage, and most of the code between these two scripts is similar because the character types have so much in common.

Continue reading
Coffee and Code

How web domains work

I’ve been freelancing as a web programmer for more than 6 years now, but (surprisingly) I’ve never known the intricacies behind how web domain names worked until today (I had to help a client resolve some issues regarding it). The understanding came to me in an epiphany only after I’ve read and pondered on many articles, Wikipedia pages and Stack Overflow pages over the past few days.

Because web domains can be an incredibly complex business, and all the online instructionals I’ve found are really long, I wrote this in such a way that it imparts a big picture view. Hopefully, it’ll help you figure things out faster than I did.

Continue reading

Content begins after the advertisement:


War of the Worlds - Melcolm Lek
Art by Melcolm Lek

The high concept: what it is and why you need it.

The high concept is a concept (no pun intended) that is very relevant to people working or studying in creative fields. In this article, we’ll be tackling this idea from the perspective of games design, though it is a relevant concept for any industry where you are trying to create a product or service that appeals to people.

Let’s start with a simple definition of what a high concept is: it is the first thing you tell someone when they ask you what your game is about. Here are some traits a high concept should have:

Continue reading