Hi, I'm creating a "blocks" game (Tetris style) blocks are created randomly on five columns. I'm trying "remove/stop" an X position when a column is filled with blocks.
I have an Array (1d) with a 5 width and 1 height with X positions where the blocks will be created. The Array it looks like this:
X0 |
X1 |
X2 |
X3 |
X4 |
0 |
96 |
192 |
288 |
384 |
I have a condition to create the blocks: Every X seconds
Create object: Block
Layer: 0
X: MyArray.At(int(random(MyArray.Width)))
Y: 200
OK, this works as expected to create blocks on a random column. My problem comes now:
Imagine I want to stop creating blocks from column 3 (192 X position) and later column 4 (288 X position):
I can create something like Delete index 2 from X axis
but then the rest of the Array it's sorted like:
So now for delete "288", it's index "2" again... I don't know if it's easy to understand... My problem it's I don't know how to remove any index with value 288 in the array.
If you know another way to create objects from "a list" of positions and how to modify the list I appreciated your help. ππ»
Before, I tried to create the blocks with something like choose(0,96,192,288,384)
. But I don't know either like remove some values of these options.
Many thanks in advance! ;)