Wednesday, May 14, 2014

Problem #5: Unreliable tilemap collision

I programmed my NPC to move on its own, but due to the tilemap collision being unreliable, sometimes the NPC just can't move the way I intended it to.

Sometimes it can, sometimes it can't.

I can't have a game that can only work by chance, so I decided not to use the tilemap at all.
I replaced the tilemap with sprites.
But the tilemap is still kinda helpful with the positioning of the object sprites. Like for example, if Tiled is telling me the tile is at (17, 32), that means the position I need to code is (17*32, 32*32) because one tile in my map is 32x32 pixel large.

This kinda make the replacing quite fast. But the code becomes quite bulky due to the number of objects in the game.

No comments:

Post a Comment