So I've started to use MF2 instead of the old The Games Factory.
I'm trying to make a managment game where you buy/build buildings and businesses. My city has five areas, each represented by a frame/level.
I want the player to be able to move around he city by switching frames, and I want the progress in each frame to be kept.
Is it true that the only way for a frame to be changed to where it was before is through global values? Becuase the only way I've found to do it is to have a global value for, say, if a house has been built or not, and then compare it at the start of the level. This seems really cumbersome and I would run out of global values very fast if I need a separate one for every factor that can be changed in a level.
Is there an easier way to do this, I wish there was a way to save the state of a frame and reload it the nex time to frame is displayed.
I'd definitely go with Don's suggestion - an array should be the perfect solution.
Each city block can be represented by one value in an array, so 0=empty, 1=house, 2=factory etc.
Use one array for each frame, and then save&load when switching.
When you create a building, you use the "write value to x,y" action.
Value is a number which acts as an id for a particular type of building (eg. house=1, factory=2).
X is the horizontal grid coordinate. It can be found by dividing the actual screen position by the width of a grid square.
Y is the vertical grid coordinate. It can be found by dividing the actual screen position by the height of a grid square.
The resulting array is hown on the right.
(each grid square is 16x16 pixels)
I suggest you look at the array examples, and read a few articles (including the one on Tile-based games, which has a few handy formulae)