Code Loop
CFour
Member Posts: 5
Hi I'm a new user with GS and I've been trying to find a way to create a grid of actors through a loop like command, does anyone have any ideas? The "Replicate" command is not suitable since the actor may vary (different tiles). Any help would be appreciated.
Comments
Some specifics like that would help. Like are you trying to control the frequency certain actors appear in the grid, or is it random? Are you populating a level this way?
It's just a demo though, actually creating a grid-based game in GameSalad would be an experiment in torture without a proper Array or Table - and a way to loop through it.
Draw your grid on some paper and basically define the positions of each place in the grid. Then make Game level attributes for each. We're talking about a whole bunch. like 1x, 1Y, 2x, 2y, etc. so you have a grid that's like this
1 2 3
4 5 6
and so on.
Make a manager actor. Do a loop for the total amount of positions. At each loop, it has to check which position you are on and reference that position. Then do a random for your total amount of types of tiles. have a rule that says if type ==1 spawn type 1, etc.
that's how I'd start my line of thinking. But to actually make this all playable would be scary. Also, these type of games usually have some sort of process that makes sure that tiles are spawned in such a way that you have a possible move, right? That part is tough in GS.