Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Collision with Tilemap Layer
#6
Hi,
You're experiencing two unrelated problems:

1. Seems that TLN_GetTileInfo() is not correctly protected against passing negative values as world coordinates, that's why sometimes "segfaults" when walking left and up. I should protect it, menawhile you can do it in your application, checking against negative values and if so, adding the size of the negative dimension. You can get them at runtime with TLN_GetLayerWidth() and TLN_GetLayerHeight().

2. Bad detection: you forgot to initialize city->initx and city->inity to 0 at startup, they have undefined values you're setting up the starting position of the layer with these unknown values. That's why what you see is not what you expect, you're checking in one place but displaying another. Setting them to 0 and then calling TLN_SetLayerPosition() will fix it.
Reply


Messages In This Thread
RE: Collision with Tilemap Layer - by megamarc - 04-11-2020, 04:37 PM
RE: Collision with Tilemap Layer - by megamarc - 04-13-2020, 02:59 PM
RE: Collision with Tilemap Layer - by megamarc - 04-14-2020, 03:36 AM
RE: Collision with Tilemap Layer - by megamarc - 04-14-2020, 02:45 PM
RE: Collision with Tilemap Layer - by megamarc - 04-17-2020, 05:08 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)