Posted By
|
Message
|
Buster BLING COMMANDER
Registered 03/06/2002
Points 1545
|
13th March, 2012 at 13/03/2012 10:55:01 -
What would be the best method of saving the position and direction of multiple of the same/different active objects, for example buildings in a SimCity type project? I have a basic understanding on how to use the ini object, I'm just not sure how to go about this.
|
Sketchy Cornwall UK
Registered 06/11/2004
Points 1971
|
13th March, 2012 at 13/03/2012 12:40:18 -
I wouldn't use an Ini file. Assuming it's grid-based like SimCity, an array is definitely the way to go.
The X and Y offset would represent the X and Y grid positions, and the Z offset would be the type of info to store (eg. 0=building type, 1=pollution, 2=happiness, 3=something else...)
eg. ValueAtXYZ( "Array", 4, 5, 1)
...would return the pollution level at grid position 4,5
Edited by Sketchy
n/a
|
Windybeard Games
Registered 14/04/2005
Points 219
|
13th March, 2012 at 13/03/2012 20:09:04 -
I always use arrays, much more scope regarding what can be done (with ease) plus they are more secure. I fully agree with Sketchy
n/a
|
|
|