How to change maps in sti

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Dangerous beetle
Prole
Posts: 15
Joined: Sat Aug 13, 2022 7:25 am

How to change maps in sti

Post 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.
User avatar
Bobble68
Party member
Posts: 162
Joined: Wed Nov 30, 2022 9:16 pm
Contact:

Re: How to change maps in sti

Post 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.
Dragon
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: How to change maps in sti

Post 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!
Dangerous beetle
Prole
Posts: 15
Joined: Sat Aug 13, 2022 7:25 am

Re: How to change maps in sti

Post 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!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests