When tile-based worlds collide...

Blitz3D Forums/Blitz3D Programming/When tile-based worlds collide...

since the enemies move relative to the map, which is relative to the player, I just can't get a successful coordinate formula going
I remember this problem well -- it comes from getting logic and rendering mixed up with one another (ideally your program should function without rendering anything). Like I mentioned, everything needs a world coordinate -- tiles, enemies, the player and even the camera (because having a concept of a camera is as useful in 2D as 3D). Once you've done that you render whatever you need relative to the camera's world x/y because every object already has its own world x/y relative to it. How a world x/y translates to the screen is up to you, but I tend to have the camera render a screen's worth of tiles to the right and below it, rather than conceptualise it as rendering centrally:
|---------------|
|X              | 
|               | Camera's world x/y as screen 0,0
|               |
|---------------|

|---------------|
|               | 
|       X       | Camera's world x/y as screen gwidth/2,gheight/2
|               |
|---------------|