Page 1 of 1
Platformer state in a top-down RPG
Posted: Mon Jan 27, 2020 10:56 pm
by Dilir
Hi! I'm new to Lua and Love2d. I've accumulated a little programming experience here and there throughout the past few year, nothing super complex though. I am looking into creating a top-down RPG that plays like any normal RPG but there is an interaction in the game that updates the game state into a platformer level. Imagine an arcade machine in the game that is a platformer game you can play when you interact with it in an RPG.
I know there are several libraries to check out but if you know some that might be relevant, what libraries should I look into learning? Or are there built-in functions in Love2d that will suffice?
Re: Platformer state in a top-down RPG
Posted: Tue Jan 28, 2020 1:28 am
by pgimeno
I'd say the main issue with a platformer is handling collisions. You could perhaps handle them yourself, if you dare, but I don't recommend that, as they are a bit more complicated than they may seem at first sight.
You could use
love.physics for that, but then you need to handle every object through love.physics. Some people have done that successfully.
However, instead I recommend Bump
https://github.com/kikito/bump.lua, because it's both simple and powerful, and lets you do things your own way. It has its drawbacks, though, like not having the ability to do ramps easily, and being limited to rectangles. If that's too much of a problem, besides love.physics there's also HC
https://github.com/vrld/HC which allows arbitrary shapes, but is harder to use than Bump.
Re: Platformer state in a top-down RPG
Posted: Tue Jan 28, 2020 3:35 pm
by Dilir
Ayy thanks for the recommendations. I'm having a tough time visualizing how the code will be structured with all the different modules, and I guess these are things you learn through experience. I'll try to get the hang of using love.physics before trying out the other ones since you say it will have to be used for everything in case I use it.
Re: Platformer state in a top-down RPG
Posted: Wed Jan 29, 2020 1:30 am
by pgimeno
If your problem is the state switching, there are libraries for handling a stack of states, allowing you to just change state, or to push current state to the stack and then change, or to pop a state from the stack if it was previously pushed. Take a look at
https://love2d.org/forums/viewtopic.php?f=5&t=86617 for example. Also, at the bottom of that same page, I summarize some others.
Re: Platformer state in a top-down RPG
Posted: Fri Jan 31, 2020 8:35 pm
by Dilir
Hey! I missed this reply but thanks for the suggestion, I'll definitely check this out. I'm honestly still kinda lost amidst ALL the new stuff but I appreciate the help.