How do I make a platformer?

Hello! I’m a new Defolder (is that the name?) and I want to make a basic platformer for now, I have some bigger ideas I can integrate later. I just need to find out how to make the falling physics, collision, and how to insert .png files as sprites and backgrounds.

Thanks,
D Games

Hi @dabjeb12

I’m also making a platformer. There’s some good tutorials here thaty will get you going: https://www.defold.com/tutorials/getting-started/

BUT, if you have aspirations beyond even the simplest platformer you need to check out Platypus: https://github.com/britzl/platypus

It will save you a whole heap of pain. Make sure you give the demo a try on the github page.

Good luck!

5 Likes

It is if you use it! :grinning:

3 Likes

@approbo.games I got a strange error message whenever I play and press an arrow key.

ERROR:SCRIPT: /main/Runner.script:6: attempt to index global ‘self’ (a nil value)
stack traceback:
/main/Runner.script:6: in function </main/Runner.script:5>

Please help! I followed the platypus readme exactly (meaning i copied and pasted).

Detfolder, Defoldian, Defoldsterino – whatever floats your boat. Apart from the great suggestions above, you could check out the Platformer Creation Kit which features assets, code, and even a tutorial on how to make a platformer.

3 Likes

@dabjeb12, without seeing your code it’s difficult to establish the cause but it could be:

@britzl, the player movement part of the readme on the main platypus page contains:

function update(dt)
	self.platypus.update(dt)
end

Should this be?

function update(self, dt)
	self.platypus.update(dt)
end

@dabjeb12 give this a try

Yes, you’re right. Fixed that! Thanks!