The Mezunian

Die Positivität ist das Opium des Volkes, aber der Spott ist das Opium der Verrückten

Let’s Code a Crappy 2D Platformer Like Millions o’ Other People on the Internet & Lose Interest & Give Up Only a Few Months In, Part XXVII

Milky Mountains

I don’t remember if I mentioned before my decision to add a “mountain” theme to lighten “desert”’s load, but I did. This is s’posed to be the 1st mountain level, so hopefully it’s not too hard for what will the… ¿5th level? There are quite a few areas that are free, such as a few o’ the slopes & the upward slope @ the end ( it’s e’en easier if you don’t jump; I think you’re guranteed not to get hit if you just hold left ).

The most trouble I had with this level was coming up with ideas. It’s a rather plain level; but I don’t want every level to be a completely different gimmick or else the gimmick levels won’t feel fresh anymo’. Thus, this is just a normal level heading toward an end goal where most o’ the challenge is basic platforming & not getting hit by enemies. The 1 twist I allowed was having you spend most o’ the level going leftward, since I noticed most levels have you go from left to right, horizontally. Should probably add some mo’ verticality & s’pecially mo’ twisty paths. I did have an idea for a level where you start in the center & spiral out, but I’m not sure where I want to use it. Maybe “Hoot Chutes”.

There was an early version o’ this level that was e’en lamer than this. Then I came up with the chicken enemies — or rather, found a character design that seemed interesting ’nough to not make me feel as bad ’bout ripping off Koopas. I don’t remember if I said this yet, but making enemies is hard when the Super Mario Bros. games already came up with all the good ideas.

Also, I don’t show it here, but there’s a glitch I don’t know how to fix: in the hidden alcove with the gems, if you jump with Autumn’s left side slightly under the ceiling, Autumn will pop up straight through the wall to the top o’ the level. Probably caused by the code that keeps Autumn’s movement gainst walls or floor smooth by making horizontal collision detection mo’ demanding for vertical collision & vice-versa.


I wasted a lot o’ time trying to optimize things, since this code is hilariously inefficient ( as well as cumbersome ). This time I actually profiled & found that using hash maps with strings as keys is a big waste, probably ’cause comparing strings is slow, & it’s done every frame to get the texture for every sprite, block, background, & letter o’ text. So I tried replaced this with some complicated system wherein all graphics strings are replaced with IDs, which the renderer would use to directly index an array o’ textures & the renderer would only compare strings for the creation o’ any graphic object to find which ID to give it ( either by finding an existing index o’ a texture or creating 1 if 1 didn’t already exist ).

This caused memory leaks & problems somewhere, so I scrapped it all. But I did capture some videos showing some o’ the greatest hits o’ the errors caused in the making:

I wasted e’en mo’ time playing round with refactoring the entire project into code that’s less sludgy. Not surprising, I haven’t found a way to make the sprite code less cumbersome; but I still have that other code lying round & may return to it later — ’specially if I can figure out how to get the racer sprite’s sequence o’ inputs to match up with “Rooftop Rumble” so she doesn’t fall off due to the slightest o’ differences or something.

Levels I May Work On Next:

  • A farm level ( ¿in the ‘mountain’ theme set? ) that challenges you to defeat all the chicken enemy in its various forms ( this video only shows 3 forms; there’s also diagonal & circling chickens ) — think an easier version o’ the “Playing Railroad” gimmick, but without the ability to shoot.
  • “Lunacy”, with a gravity mechanic, which I’ve implemented already.
  • A bunch o’ other levels like “Pepperoncini Pyramid” & “Hoot Chutes” that I’ve been saying I’d work on for months.

Here’s where the messy source code is

Posted in Boskeopolis Land, Programming