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
3

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.

HOPE THIS HELPS !

3


2

The last sentence is The Hard Part™.


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 ...


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.


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.


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


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

Working on Wall-Jumping now.
Complete !

Posting:
https://www.lexaloffle.com/bbs/?tid=35221


1

Cart #toad-0 | 2019-09-02 | Code ▽ | Embed ▽ | No License
1

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.
-Scrub


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 ?


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


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.

https://youtu.be/Qr0RSz-HPIw?t=404

. . .

Looking forward to seeing your take on Ghostbusters !


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


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.



[Please log in to post a comment]