Objective: Set up Flip Behaviour for Player Sprite
As shown above, when the Player moves forward and backwards, the rotatio of the Player has it always facing to the right. We need the Player to face left when moving that direction.
There’s an easy way to set the sprite facing rotation and that is using the Sprite Renderers Flip functions. This mirrors the sprite in the X or Y axis. We will flip the X making the sprite face left.
There’s many ways to do this and it may be common to put this logic in the Player script but…
Objective: Set up the Players Idle and Run animations.
As seen above the Player has no animation attached when idling or moving. Let’s fix that.
Start by opening the Animator and with the Players Sprite selected in the hierarchy create a new animation. To keep things organsied save it to a new folder in the Player called animations as there will be a few and they need to be kept seperate from any other enemy or so on game characters that have animations later.
With the animation window open highlight and pull all the animations from the idle sprite we created earlier.
Objective: Set up Player Jump and Speed
Currently the Player moves left and right (without animation) using the left and right/a and d keys. We want to have the Player jump when the space key is pressed.
We start with creating a float for the jump force. We need to keep the script clean so we move the movement logic form the Update method to its own Movement method. Next we run a conditional if to check if the space key has been pressed. …
Objective: Set up Player Idle Sprites and Basic Movement
The above image is the spritesheet for the Players idle animation. We will follow the same process as before to slice this up into frame sprites.
Next we create an empty object in the scene and reset the position. Rename it Player then drag the first frame of the idle sprites into the Player, rename it Sprite and reset its position. Now we create a Player script inside a seperate scripts folder and attach it to the Player object. …
Objective: Set up Tilemap for the Project
Firstly we set up the interface layout to work in. If you are missing the Tile Palette go to Window, 2D, Tile Palette to bring it up then dock it next to the scene view. Next right-click in the hierarchy and select 2D object, Tilemap. This gives us a grid. The grid is where we paint the environment.
Objective: Project setup
The above image is a screenshot from the game we will be building from scratch. This will be done in stages and documented with posts along the way, showing the progression at each stage.
The game will be a 2D mobile game with on screen controls, Enemy AI, Attack and Loot systems, Ads and more. The final stage will include testing and publishing to the Google Play Store.
To start off we create a fresh git hub project and link it to a new Unity project on our local development system. Each stage of the project will be commited to this git hub repository to keep track of the progress along with the medium posts. In the next post, we will start by looking at building the environment.
This post is just a list of all the posts involved in the 2.5D Platformer sections within part 2 of the GameDevHQ program.