Making the terrain your character is walking on have an impact on the controls can add extra depth to your control scheme.
For a top down 2D game there is not any gravity and your player is not using collision detection to walk on surfaces so doing things like walking up a set of stairs or falling off of a platform can require a little extra thought. There are many ways you could approach a problem like this, however a quick and easy way is to check what surface the player is walking on and then calculate how the player should move based on the surface.
In the example the player can go up the stairs and fall off the cliffs if they approach them. When pressing left or right on the stairs the player needs to actually move up the stairs and not just into them in order for the control scheme to feel natural.
How can we make a platform decide if a player can move through it or get stopped by it? An easy solution is to use the y coordinate of the player to turn the platform’s collider off and on. If the player is lower than the platform then they should be able to jump up through it and land safely on top. You can also hop down off the platform by turning off the collider for a short amount of time.
You can play test it here (full screen is not working at the moment).
Learn how to create your own animated space vista to use as a background in your game or menu system. This basic tutorial shows a really easy method to get great looking results fast without using any code.
In this video we go from creating a character using self made assets to animating it and controlling the animations and movement via the keyboard! There’s a lot to take in, but I walk you through every step.
We’re going to have a lot of fun.