B
Bhreno Kevin
Guest
Hello!
I have a project "Match 3" style where 3 random pieces are created each time and they descend (y + 32) whenever there is nothing solid in y + 32.
If y + 32 has something solid, these three pieces go to "solid pieces" (another type of pieces).
However, it turns out that the second piece (which is in the middle) will always stop inside the first piece (the bottom piece) when they hit something solid. This is not the case when the first piece is yellow.
Obj_parent_pieces_down codes:
CREATE:
STEP:
KEY DOWN:
Notes: The "down" pieces are not solid, just the normal pieces are. And there is also an obj_block that is also solid.
I have a project "Match 3" style where 3 random pieces are created each time and they descend (y + 32) whenever there is nothing solid in y + 32.
If y + 32 has something solid, these three pieces go to "solid pieces" (another type of pieces).
However, it turns out that the second piece (which is in the middle) will always stop inside the first piece (the bottom piece) when they hit something solid. This is not the case when the first piece is yellow.
Obj_parent_pieces_down codes:
CREATE:
Code:
y_solid=false;
Code:
if !place_free(x,y+32)
{
y_solid=true;
}
if y_solid=false
{
y+=32;
}
else
{
with(ob_piece_yellow_down)
instance_change(ob_piece_yellow,1);
with(ob_piece_blue_down)
instance_change(ob_piece_blue,1);
with(ob_piece_orange_down)
instance_change(ob_piece_orange,1);
with(ob_piece_pink_down)
instance_change(ob_piece_pink,1);
with(ob_piece_purple_down)
instance_change(ob_piece_purple,1);
with(ob_piece_green_down)
instance_change(ob_piece_green,1);
}
Code:
if y_solid=false
{
if (x<288) and (y<512)
{
y+=32
}
}
Last edited by a moderator: