TEMPLATE FOR 2048-DROP GAME

You're viewing a single comment in a conversation. View all the comments
  • 6 Comments

  • Order by
  • Hello! How can I make sure that the blocks are always combined? Now the block with a smile does not work correctly and sometimes does not merge.

    • Hi. In this example, the smiley block is the most recent one. This is the maximum block id in the game and therefore it will be repeated

      • I understand it. But why does this block sometimes disappear and sometimes not? For example, if the same block falls on him, he disappears, but if he stands next to him, then not.

        And how to make a block created by touching it on the board, and not where it wants?

        • The maximum block id is 8. But when these two blocks, whose id is 8, merge together, a new block is created, whose id is 9. But its appearance does not change, since this is not provided in this example. And therefore it seems that, two visually identical blocks do not merge.

          I didn't understand the second question, I'm sorry. The block is being created in the column where the touch was

          • Now the block on top is always created at startup, how can I make it create when clicked? The move function start_new_round does not help.

            If the block is 9, then how can it be destroyed upon contact with block 8?

            • Why doesn't start_new_round help? This function must first be removed from the 2nd event. Then add a global variable, for example START=0. And Make the condition [On any touch start AND start=0] then [call start_new_round and set start=1]

              A block with ID 9 should not be destroyed with ID 8. You just need to change the logic so that a block with ID 8 is also created from merging blocks with ID 8. Or add new blocks so that the maximum block ID is higher and the game ends on it