Player Movement


Hello Reader,

Welcome to the first of several DevLogs that provide readers with details of each stage/topic associated with the development of Dungeonator. The weeks topic addressed is on player movement and how it was implemented for the game and a visual demonstration to show how the player moves and interacts. This post will also address the given feedback on the game and how possible solutions were used to improve the movement of the player.

As I wanted to create a 2D isometric platform game, the initial process that I had to define was that of how the player will move and interact with objects in the game and what I ultimately think the player should be able to do throughout the game. The first step on the road to accomplishing the players movement was to decide if the player should be able to move in 4 or 8 directions and locate a suitable sprite with the desired number of animations equal to the number of directions to move in. For the player I decided that it should be able to move in 8 directions as it gives more of a 3D effect to the sprite and shows off more of the art, I also find that you can get to a desired location quicker.

The player uses the script eight way movement from previous KIT109 practicals to allow the player to move around when pressing the w,a,s,d keys, it has a Rigidbody 2D and Capsule Collider 2D so that it can interact with the background and other decorations/obstacles in the scene and has an animator attached to the sprite that uses a controller so that each direction of the player has the appropriate animation for the required direction. Using the animator, currently I have made state blocks for walking and idle with transitions between them so that the animator knows when to use a specific animated state. The GIF below shows the player starting at idle, moving around using w,a,s,d and interacting with an object in the scene.

Some of the feedback that I have been given on my player movement thus far was about my initial upload to itch when my player would get stuck on the backgrounds tilemap collider and not be able to move away, and when the player collided with the column it would start spiraling but thanks to the help received the player doesn't get stuck on the background due to making its Rigidbody static, and freezing the z rotation on the player fixed the spiraling issues. Something that still needs to be fixed from feedback is somehow altering the colliders associated with the decorations layer of the tilemap so that the player can walk directly below the pillar base instead of colliding with nothing and to implement code to allow the player to pass behind the pillar by fiddling with the sorting or ordering layers of both the player and tilemap.

Get Dungeonator

Leave a comment

Log in with itch.io to leave a comment.