How to change maps in sti
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 15
- Joined: Sat Aug 13, 2022 7:25 am
How to change maps in sti
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
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.
Dragon
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: How to change maps in sti
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.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.
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!
-
- Prole
- Posts: 15
- Joined: Sat Aug 13, 2022 7:25 am
Re: How to change maps in sti
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!
Who is online
Users browsing this forum: No registered users and 4 guests