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#] | Code | 2019-08-30 | License: CC4-BY-NC-SA | Embed
1

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 !

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

2

The last sentence is The Hard Part™.

P#67050 2019-08-30 20:01
:: dw817

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
:: dw817

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
:: dw817

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
:: dw817

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

Working on Wall-Jumping now.
Complete !

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

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

Cart [#toad-0#] | Code | 2019-09-02 | No License | Embed
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

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

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
:: dw817

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 !

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
:: dw817

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]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-11-22 03:24 | 0.024s | 4194k | Q:57