Dynamic Arrays and City Generator

0 favourites
  • 3 posts
From the Asset Store
Firebase: Analytics, Dynamic Links, Remote Config, Performance, Crashlytics on Android, iOS & Web Browser
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • This is an interested idea. I will try this and see if there are any limitations that may arise. Thanks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)