To be clear: I don’t know that much about game programming as I’m still learning. I only programmed microcontrollers and PC software so far. I’m new to the Arduino platform too, so i don’t know how much computing power it offers. I mean i know the specs but it all comes down to how good the compiler is etc.
But heres my idea:
You know the position of the block on the tilemap and you know the size of the block. You could check the collision not for only 1 but for 4 rectangles. These 4 rectangles are determined by the position and the size of the block. I made you an example “picture”
That’s why I said that I’m not sure about the computing power. I don’t know if this kind of collision testing slows down the system. If it does you could check for the block rectangle in general, so you know that this particular block was hit by the player. Then you could check again which side was hit by using 4 different rectangles.
This code is just an example to show what i mean, it’s not tested
if(tft.collideRectRect(block_x, block_y,16,16, player_x, player_y. 16, 16))
if(tft.collideRectRect(block_x + 1, block_y, 14, 2, player_x, player_y, 16,16) MoveBlockDown();
if(tft.collideRectRect(block_x + 1, block_y+14, 14, 2, player_x, player_y, 16,16) MoveBlockUp();
if(tft.collideRectRect(block_x, block_y + 1, 2, 14, player_x, player_y, 16,16) MoveBlockLeft();
if(tft.collideRectRect(block_x + 14, block_y + 1, 2, 14, player_x, player_y, 16,16) MoveBlockRight();
*€dit: I almost forgot it: I LOVE KWIRK I still own the GameBoy cartridge It was one of my first gameboy games and I played all the time when i was a child.