Log In  

Cart #jijugbage-0 | 2022-08-24 | Code ▽ | Embed ▽ | No License
1

Hi everyone! I'm working on a platformer that has endless map loop.
But now, I got stuck because I don't understand how to make the collision follow the map scroll.
In reddit, I was given a lot of great advices, but I can't solve this problem.
People say ''Use the camera to scroll map with collision'', can anyone tell me what should I do?
So sorry for my being a beginner.

P#116219 2022-08-24 06:20

It seems you are changing the positions in which the map is drawn, but that doesn't change the global position (the world position) of the map tiles. So, the map tiles are still in the same place, but they are being drawn elsewhere. That's why you are having mismatch collisions. The proper way to do map scrolling is to use the cam() command. You can read about it in the wiki: https://pico-8.fandom.com/wiki/Camera There's also a good tutorial on Nerdy Teachers about this https://youtu.be/XNTHqatlJsY

P#116243 2022-08-24 20:47

I added camera(offset,0) at draw() function.
But still the collision doesn't fit and random map function won't work at all.
I don't get it at all, so I decide to leave for a while.
Sorry for a lot of helps.

Cart #zuzoduwena-0 | 2022-08-26 | Code ▽ | Embed ▽ | No License

P#116304 2022-08-26 03:04

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-19 08:31:47 | 0.011s | Q:17