I'm making a game like Minesweeper, but I can't think of a way to have the game count the bombs around each space. I am using a 64px x 64px grid. Each space has a sprite called Rock (because it looks like a square rock). At the start of the layout, it will For Each through all of the rocks twice. Once to randomly place bombs (without putting more than one on the same spot by accident), and a second time to put Kreptons (money) of appropriate value in each of the remaining spaces. The Krepton sprite has different frames and an instance variable to determine how much each is worth. I want it to put specific amounts Kreptons in the space depending on how many bombs are around it (9 x 9 or 192px x 192px area with the current space in the center).
I'm afraid that if I put in another loop inside the second For Each loop, that it would make the game slow. Is there a way to count them without a loop? I tried this, but bcount is always zero.