True Tile Collision WIP & journey learning Defold


Sorry if not the right spot for the post!
From what I’ve seen, no one has done a collision using data from tilemap. Since I’ve done a similar thing in Gamemaker except I had to use objects on level start to create “tilemap” with indexes of necessary tiles.
I’m in the very beginning of developing this system and I’m learning Defold & LUA so I wanted to combine it under a journey of learning Defold “video series”. First one is here but it also shows one bug I encountered and I don’t know if I should make new Question post or I can discuss problems here.

EDIT: For my code bug I kinda sorted right side collision, but the left is still problematic.


Please post your specific question in a forum post. We’re happy to help!



@britzl I got it fixed myself. Coordinates starting from 1 instead of 0 throws off bitwise calculations and I couldn’t get it working, so I had to use regular calculation for snapping to tile side.



I made progress update in video format: