Sitemap
.Net Programming

Explore the .Net with the latest in C# from basic to advanced, including .Net versions 9, 8, 6, 5, Core 3.1, .Net Framework, ASP.NET Core, MVC, design patterns, OOPS, and SOLID principles. Get top tutorials, best practices, and hands-on code examples on GitHub.

Making a RTS game #22: Producing some resources with our buildings (Unity/C#)

On with our RTS game: today, we’ll make our buildings produce some resources!

13 min readAug 5, 2021

--

⬅️ Tutorial #21: Adding players and unit ownership| TOC | Tutorial #23: Implementing behaviour trees for our units 1/3 ➡️

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

In the last tutorial, we’ve worked on our units and we’ve implemented a system of ownership. In this article, we’ll start from there and focus more on our buildings: we are going to see how to have them produce some resources based on their position in the world.

Here, what I call “resources” are the three in-game resources we talked about a long time ago, at the very beginning of this series: gold, wood and stone.

For this project, I wanted my resource production system to have three characteristics:

  • the type of resources a building can produce depend on its type
  • the amount of resources a building produces depends on where it’s placed in the world: the surroundings impact the “production efficiency” of the building
  • resources are infinite: instead of having units…

--

--

.Net Programming

Published in .Net Programming

Explore the .Net with the latest in C# from basic to advanced, including .Net versions 9, 8, 6, 5, Core 3.1, .Net Framework, ASP.NET Core, MVC, design patterns, OOPS, and SOLID principles. Get top tutorials, best practices, and hands-on code examples on GitHub.

Mina Pêcheux

Written by Mina Pêcheux

I’m a freelance full-stack web & game developer. I’m passionate about topics like CGI, music, data science and more! Find me at: https://minapecheux.com :)

Responses (2)