(1010 Game) How to detect that there is no block that cannot be place in the grid

0 favourites
  • 5 posts
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • Hey, I have a problem in making this 1010 game.

    How possibly I can detect that there is no block which cannot be place inside the grid and make the game over.

  • The most straightforward way would be to check each shape at every free square, in every orientation, until there is a valid move, then stop the loop. If the loop completes without finding a valid placement, then game over.

    It is a brute force method that doesn't scale very well, but there shouldn't be any problem within set constraints like a 10x10 board.

  • Thank you for your reply,

    Yes, I have think the same way too, I just want to looking for another more efficient way.

    But if there is no other way, I think I hv just to do it anyway.

    And fortunately the square block no need to change its angle.

  • For a slightly more efficient approach, you can at least start by checking the easiest blocks, that fit into the other shapes: for example, if the small 2-block line does not fit, everything else definitely will not fit either.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okey, thanks for your suggestion I will try it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)