Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17625

How to manage the placement of units in cells and rules? (Code structuring)(C#)

$
0
0

Hello everyone,

This is a rather simple problem and so I am hoping for some simple answers!

The game I'm currently developing has a cell grid that you can place units in with some rules governing whether or not you can place units into the cells. I have an array of Units, whereby the indices represent the cells. If a cell is occupied, the value corresponding to the cell index in the array should have the unit assigned or otherwise be null. An example of a placement rule is that units can't be placed into a cell that …


Viewing all articles
Browse latest Browse all 17625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>