Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

 
Wasn't too difficult. Of course I did notice the bug where tiles spawned on top of each other.  What method are you using to track the tiles position? I can try and explain how I would do it if it helps.

The game is really good, it fits the theme really well.

Good job!

Thank you, I'm glad you enjoyed it!

Here's the code for the countdown block. The one for the countup block is identical, but excludes the countdown_iteration bit.

The var grid is an array with all of the possible grid positions, (0,1) , (2,5), etc., block_array is an array of all positions of spawned blocks, and gold_x_y is the position where you last picked up a block.

I'm pretty sure that my problem lies in the while loops, but I'm not sure.

Yep, it's the while loop. The while loop only checks random_cell not in block_array, ignoring the gold_x_y check that got you into that branch in the first place. So once in the loop, it can land right on gold_x_y, since nothing in there is excluding it anymore.
I'd ditch the while loop. Build a list of the cells that are still empty, so cell not already in block_array/equal to gold_x_y, then pick a random one from that list. 
I also don't see anything in this snippet that sets the cell you're hovering over with a dragged tile as occupied, so it might be worth checking whether that's handled elsewhere.
That first if statement is weird. I'm guessing it only fires once for the first block you spawn, assuming countdown_iteration never gets reset to 1 elsewhere (that would be bad, spawning tiles without checks). The general logic should be able to handle that case just fine on its own so triggering a spawn from here makes no sense. You can still keep countdown_iteration for whatever, just have it run at the bottom instead of gating the spawn logic.