Hello. This is my first post on these forums, so I apologize if this is the wrong place for this post.
Anyway. I've taken a look at löve and it looks to be the exact thing I would want for an indie sidescroller. Problem is, I am unsure where to start. From my searching there don't appear to be any basic 2D sidescroller engines floating around for love, but rather every project has built their own.
Is this the case? If it is, where would I look to start building my own?
If it is not the case, can anyone point me towards an engine?
tl;dr could someone point me in the right direction for making a sidescroller, either to an engine, or to someething that would help with creating my own?
[Help]Sidescroller Engine
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[Help]Sidescroller Engine
The z in zrrion is never capitalized, ever. Not even on Wednesdays.
- Jasoco
- Inner party member
- Posts: 3726
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: [Help]Sidescroller Engine
If you don't need slopes, you can look into kikito's Bump 3.0 (Not 2.0. Both threads are in the Demos forum. 3.0 is better.) collision detection and resolution library. It has a simple demo of a platformer. But it's very simple. If you want to actually do scrolling you should look into a camera library if you don't want to try and figure it all out yourself. I code my own from scratch but it's a lot of work. You could start simple and go the Knytt route where the level is divided into non-scrolling screens. Then you don't have to bother with camera math and can implement that into a later project once you've gotten the hang of coding.
See, one thing you need to remember when scrolling is that you have to learn how to cull stuff that isn't on screen. Like if you have a large tile map, you don't want to be looping over every single tile in the level every frame because like 80% of it is off screen and it's wasting time and slowing down. So you need to do some math and only loop over the visible tiles. That's one tip to remember.
Also, physics for a platformer are simple usually, but can still be a bit overwhelming. If you are new to programming you can start with a different kind of game like a top-down game where you don't need to really worry about whether you're jumping or standing on a platform.
Also, don't use Box2D for your 2D platformer unless you know exactly how to use Box2D to make it work like a normal platformer. It might be tempting to use it because it's there, but it also does not work like a regular platformer out of the box. It takes a lot of tweaking and work to make sure you can work the physics correctly. Just way too much work. Just look at Concerned Joe/Move or Die. Those are built in Löve with Box2D but took a lot of work to get where they are but the character physics might still feel "floaty" to someone used to other platformers.
See, one thing you need to remember when scrolling is that you have to learn how to cull stuff that isn't on screen. Like if you have a large tile map, you don't want to be looping over every single tile in the level every frame because like 80% of it is off screen and it's wasting time and slowing down. So you need to do some math and only loop over the visible tiles. That's one tip to remember.
Also, physics for a platformer are simple usually, but can still be a bit overwhelming. If you are new to programming you can start with a different kind of game like a top-down game where you don't need to really worry about whether you're jumping or standing on a platform.
Also, don't use Box2D for your 2D platformer unless you know exactly how to use Box2D to make it work like a normal platformer. It might be tempting to use it because it's there, but it also does not work like a regular platformer out of the box. It takes a lot of tweaking and work to make sure you can work the physics correctly. Just way too much work. Just look at Concerned Joe/Move or Die. Those are built in Löve with Box2D but took a lot of work to get where they are but the character physics might still feel "floaty" to someone used to other platformers.
Re: [Help]Sidescroller Engine
All you have to do is use body:setLinearVelocity and do velocity/acceleration calculations on your side to make it not floaty. Then whenever you need the physics engine to take over (like when you want to push an object based on some force), use body:applyLinearImpulse or body:applyForce and make sure to disable your setting of body:setLinearVelocity so the body's velocity isn't overwritten while it's being pushed. This is relatively simple logic that gives you control over how movement works.Jasoco wrote: Also, don't use Box2D for your 2D platformer unless you know exactly how to use Box2D to make it work like a normal platformer. It might be tempting to use it because it's there, but it also does not work like a regular platformer out of the box. It takes a lot of tweaking and work to make sure you can work the physics correctly. Just way too much work. Just look at Concerned Joe/Move or Die. Those are built in Löve with Box2D but took a lot of work to get where they are but the character physics might still feel "floaty" to someone used to other platformers.
Re: [Help]Sidescroller Engine
I'm not the OP, but wanted to thank you for the advice anywayadnzzzzZ wrote:All you have to do is use body:setLinearVelocity and do velocity/acceleration calculations on your side to make it not floaty. Then whenever you need the physics engine to take over (like when you want to push an object based on some force), use body:applyLinearImpulse or body:applyForce and make sure to disable your setting of body:setLinearVelocity so the body's velocity isn't overwritten while it's being pushed. This is relatively simple logic that gives you control over how movement works.
Re: [Help]Sidescroller Engine
A physics library can be great, but when you're starting out I do believe that it's a very good idea to have a go at doing some pseudo physics yourself. Having an understanding or insight as to how things like Box2D work internally can help you solve problems when you do use them, and adds to your overall grounding. You might even pick up some habits or techniques that are useful elsewhere (this is particularly true with data structures).
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Who is online
Users browsing this forum: Ahrefs [Bot] and 7 guests