Creating a minesweeper minefield

Hi All,

For the life of me I can’t figure this out. How can I use two integer variables (Width and Height) to spawn actors of x amount of times width and y amount of times height.
I have added a default square, just need to spawn in my ‘grid’. I know each square needs to be added to an array on creation, I assume this will be a vector2D array? Please correct me if wrong. Thanks

You want to use 2 for loops. One will control the rows or your X axis and the other will be nested inside the first and will control moving to the next row along your Y axis.

Imagine it as an elevator moving to each floor and letting off people equal to the amount of rooms on that floor.

When spawning the squares you will need to offset their position based on the current row and column that you are currently looking at.

Did you manage to find an solution to your question?

If so could you please mark this answer as correct if this was what you were looking for or post the correct answer yourself so that this ticket can be closed.

Thank you.

Do you still need assistance of did DevilsD solve your issues?