Log In  

I'm very new to Pico-8 and just started experimenting with maps and different rooms. In this process I found a bug that happens any time I change my map at all. The pixels change out fine, but the collisions are always the collisions I place in the map(0, 0) coordinates, is there something I'm missing?

P#138963 2023-12-21 05:23

1

This is a problem specific to your code, not pico-8, so it's hard to help without knowing the specific code you're using for collisions. I'm guessing you followed a tutorial, in which case the solution will be based on what the tutorial failed to mention or clarify sufficiently.

That said, this sounds like the most common collision problem that has popped up repeatedly here in the forums. That is, the map() function, the fget() function, and the mget() are all fetching sprite data, not collision data, and at least some of the tutorials that advise using them for collisions based on which flags a sprite don't seem to be clear about that. If that's the issue you've encountered, then you'll need to keep track of the map offsets and apply them when using mget(). That way the code to fetch which sprite is at a specific map position will look up the correct map position.

P#138985 2023-12-21 15:21

[Please log in to post a comment]