Log In  

As Platformers seems to be on the tips and brains of people, I remember someone once mentioned it was difficult to make a platformer. If you have a reasonable background in math, I think it can be done fairly easily.

Here then is my sample engine to demonstrate how it can be done. I have geared this particular engine to match as closely as I can Nintendo's own Super Mario Bros game without using look-up tables.

Cart #kinezapubo-0 | 2019-08-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

Keys are LEFT, RIGHT, and (O) to jump.

Note also I am multiplying everything by 100. The reason is simple. Most programming languages start to give incorrect values even doing simple things like subtracting .1 or .05 from a real number. By keeping everything integer, you do not have problems with the limitations of the language's inability to handle real numbers.

From here also it should be possible to make a simple platformer that detects walls, surfaces, and even allow the famous Wall-Jump where you jump from wall to wall to climb an area.


P#67045 2019-08-30 18:21 ( Edited 2019-08-30 18:22)


The last sentence is The Hard Part™.

P#67050 2019-08-30 20:01

Oh ? Hmm ... A challenge then. I was thinking of expanding this demo to have a 2-way scrolling field (parallax) - and, if you like, wall jumping. I drew some sprites for this a few months back. Let me see ...

P#67051 2019-08-30 20:05 ( Edited 2019-08-30 20:10)

I was thinking about things like edge detection, platforms, one-way platforms (where you can jump up through them, but land on them on your way back down), etc.

P#67055 2019-08-30 20:23

Just transferred the sprites and working on the room generator. You would need edge detection to do it correctly. For the moment I'm just going to look at one tile-type, solid.

Can easily add one-way doors tho. Did this back in S2.

P#67056 2019-08-30 20:32

Room generator complete. Working on "drop-in" tool and edge detection. The Wall-Jumping is something I've never done before. Should be interesting to code. :D

P#67059 2019-08-30 22:22

Drop-In tool complete.
Sprite handler complete.
Edge detection complete.

Working on Wall-Jumping now.
Complete !


P#67080 2019-08-31 18:09 ( Edited 2019-08-31 20:02)

Cart #toad-0 | 2019-09-02 | Code ▽ | Embed ▽ | No License
Hi David! Long time no speak, ha. Say I found your plat-former demo and added the best Mario character to it, and just the bare minimum of music.

P#67130 2019-09-02 16:14 ( Edited 2019-09-02 16:14)

Hi Scrub. Yep, it's been a-while. I keep losing track of that chatty thing. That's fine. I'm still working on this other code.

How have you been ? Dju redo your pizza game ?

P#67134 2019-09-02 16:43

ehh not yet, I kinda forgot about it. I am however in a spooky game jam and I'm working on a ghostbusters game

P#67135 2019-09-02 17:12

Well I have a new computer now, Windows 10. UuUgh. Made some much-needed mods to the OS to keep Microsoft outta my business.

Almost makes me wish I had Ubuntu. Almost. :)

You still are incredibly talented with your music ability as heard above. Like what you did to my 1st generation platformer. Dju try the next ?

Was thinking of making a treasure-hunt with it. Something simple. I would need also to ensure that the randomly generated platformer area would be possible to reach all areas. Maybe add a double-jump that goes an extra half-height.

Wall jumping is kinna screwy. It works but there's no special animation or timing of event to show gripping to the walls like Batman does here.


. . .

Looking forward to seeing your take on Ghostbusters !

P#67155 2019-09-02 21:10 ( Edited 2019-09-03 04:01)

Maybe rather than a wall jump maybe a climb? Kinda tossing ideas.

P#67158 2019-09-02 23:13

Climb is good, Scrub.

From what I've seen in platformers, using a single wall element would not be good as the player could then always climb to any precipice.

It would need to be special kind of wall that can be climbed. This would not be a problem for human-generated maps but my obsession with the computer always generating the playfield would definitely make it more complex to code - and when in an instance to use it.

P#67166 2019-09-03 03:59

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2023-02-07 06:15:59 | 0.013s | Q:29