Dynamic Arrays and City Generator

Get help using Construct 2

Post » Thu Jun 12, 2014 1:38 pm

Hi

I want to make a strategy game where the player will be able to conquer and manage multiple cities. Each city will have a number of statistics (location, population, type and location of building etc). I also like to give the player the opportunity to randomize the map when he starts a new game. To do this, I am thinking of using 1 array for each city, that will hold all this information inside.

Since my game will feature a lot of cities, I would like to ask if there is any way to dynamically produce arrays in the beginning of the game. The current way to generate arrays is to drag and drop them from the editor, which is not practical when I want to produce 100s of cities and distribute them on the map or when I want to give the player the opportunity to choose the size of the overall map (eg Small map/55 cities).

Any thoughts on the subject?
B
5
Posts: 20
Reputation: 370

Post » Thu Jun 12, 2014 2:52 pm

I would probably make 1 city sprite and give it variables according to what information you need them to hold. Then I'd create multiple instances of the same object with the event sheet. Every instance of the city should receive its own id that you can use to distinguish between the cities.
B
6
S
1
Posts: 41
Reputation: 762

Post » Fri Jun 13, 2014 2:31 pm

@EightBitBattleCat

This is an interested idea. I will try this and see if there are any limitations that may arise. Thanks.
B
5
Posts: 20
Reputation: 370


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, brunopalermo and 10 guests