Sitemap
CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Member-only story

CODEX

Making a RTS game #3: Setting up in-game resources (Unity/C#)

Further down the rabbit hole: let’s add in-game resources and building costs to our RTS!

8 min readMar 25, 2021

--

⬅️ Tutorial #2: Adding a very basic UI | TOC | Interlude #1: Introducing an event system ➡️

📕 Get the ebook and bonus material on Gumroad!
🚀 Find the code of this tutorial series on my Github!

In the previous articles of this series, we saw what a RTS video game is, how to program a core feature (placing buildings) and the basics of Unity’s UI system.

Another crucial part of RTS games is the management of in-game resources such as gold, wood, stone… Those resources can be collected by the player from the environment via different means (usually, using specific buildings that allow you to harvest a specific resource type) and then later re-used to produce and upgrade your units.

We won’t discuss resource collection today but rather focus on defining and using in-game resources for our building construction.

In particular, our current building placement system lets you place as many buildings as you want. In truth, we want buildings to consume resources and thus the construction to be available only if you…

--

--

Mina Pêcheux
Mina Pêcheux

Written by Mina Pêcheux⁠

I’m a solo game dev & content creator. I love to make and talk about games (and also 3D and music)! Find me at: https://minapecheux.com :)

CodeX
CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers