Pulp Simple Platformer Example

Hi everyone! For all who's looking for a basic platformer setup with gravity and stuff. Here it is! Hope this helps, and let me know if you find any bugs.

version: 0.0.2
Fixed the collecting bugs that Scott mentioned below
platformer-example.json.zip (3.5 KB)

This script adds gravity to the player.

Jump button: A

Screenshot:
Screenshot 2022-04-03 at 12.47.15

4 Likes

Nice little demo! I like how you have contained the code entirely within the player script.

A couple of minor bugs on collecting items:

  • If you press up you can collect items from the tile underneath
  • Jumping into items won't collect them

I think the second should be solved by making sure to call collect on a tile whenever you "goto" it. The first might require overriding collect on items or something.

It would be cool if you could make gravity accelerative, rather than falling one tile per interval the interval could decrease for every tile you have fallen and then reset on landing maybe. It would also be nice if the player actually jumped up through the tile directly above them too rather than warping immediately two tiles upwards. I imagine the code could get complex fast!

1 Like

Thanks! I kept it as simple as possible so that it's readable and adjustable to peoples needs. So I didnt wanna add the complexity but people can ofcourse add that themselves if they use this! Hope it helps some :slight_smile:

As for the bugs. I Will have a look at home. Thanks for trying it out!

1 Like

Fixed the following minor bugs above that orkn Scott found for collecting items:

  • If you press up you can collect items from the tile underneath
  • Jumping into items won't collect them
1 Like

Can someone PLEASE show the code. I can't open it

2 Likes