Page 1 of 1
How to change maps in sti
Posted: Fri Jun 23, 2023 2:28 pm
by Dangerous beetle
Hey guys, Here I am with one more problem. I am using simple tiled implementation (or sti) in my love2d game and what I want to do is after hitting a collider class "win"(I am using windfield as physics library) I want to change the map to change the level but I don't know how to do it.
Re: How to change maps in sti
Posted: Mon Jun 26, 2023 10:25 pm
by Bobble68
I'm not familiar with windfield, but I imagine it has a function to destroy existing objects. Just iterate through your tiles and delete them, before doing the same thing you originally did to load the tiles.
Re: How to change maps in sti
Posted: Tue Jun 27, 2023 1:21 pm
by pauljessup
Dangerous beetle wrote: ↑Fri Jun 23, 2023 2:28 pm
Hey guys, Here I am with one more problem. I am using simple tiled implementation (or sti) in my love2d game and what I want to do is after hitting a collider class "win"(I am using windfield as physics library) I want to change the map to change the level but I don't know how to do it.
What's the problem you're having- is it with doing something after the collision detection, or with changing maps all together? I can't help with the collision, since I've not used the windfield physics library. But if it's with loading the map, you can just load the new map like you loaded the old map at the start.
I know there are two collision detection libraries that work natively with STI and TileD, Bump2d and (I think) Box2d (going by memory here). These are pretty easy to set up and use with STI, and might be more intuitive.
Sorry if that doesn't help!
Re: How to change maps in sti
Posted: Tue Oct 24, 2023 4:53 am
by Dangerous beetle
Yes, let me explain the problem, I have a map with some colliders, and when I change the map, the colliders still remain there, let me check if there are any functions for destroying objects in windfield, Thanks a lot for replying, everyone!