1x1 tilemaps

I decided to try and solve this post, and I did it! Here it is:

It includes: jumping while on terrain, walking on hills (being able to climb pixels), walking under smaller platforms, and climbing on high hills (being able to climb multiple pixels but slower).

If you find a problem, feel free to show it!


How can I make it so that it is more like a tilemap? I want the camera to follow the sprite over longer amounts of terrain.

Instead of using the background image, you’d want to use sprites and set the z-index to be lower than the other sprites. Then you can just use the camera like normal (it works without a tilemap). You’d have to do some math to figure out which image the sprite is over at any given time, I’d probably make a function called “test pixel” and have it take in an x/y.

If you want camera boxing to work correctly (i.e. so that the camera can’t move beyond the edges of the map), then you’ll want to make a transparent tilemap that is the same size as your in-game world.

Also, if you want this game to work on hardware, don’t use too many fullscreen sprites! They take up a lot of code space (there is a limit on how big a program can be and still be loaded on the device). Also, don’t call “set pixel” or any other function that changes the image because that will probably cause memory issues

1 Like

Thanks! I was doing this before, but I needed to center the map onto the tilemap for it to work. Here is the old version:

And the new one:

Here is what I changed: