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.
Develop games in your browser. Powerful, performant & highly capable.
Okey, thanks for your suggestion I will try it.