DEVLOG - Player Movement
For the first week of development for Ghost Escape, player movement was the main aspect to finish. Feedback from classmates was also attributed to helping further develop the improvement of the following code.
For the development of the player movement, I am currently just using a red block as the sprite, this is because I plan to get the player movement properly working before implementing graphics. The player is to be able to move left and right whilst being able to jump. To be able to interact with the environment the player was given a rigidbody2D and a collider2D. When first developing the movement, I started working on moving left and right. When programming I used transform.position. This allowed for the smooth and wanted type of movement for the player. For the movement of the jump, transform.position was not possible as when first tested the player went up but did not return back down. This lead me to using rigibody.velocity allowing the player to gain the wanted movement.
When testing the movement, I took notice that the player can infinity jump, even whilst in mid-air, this was also taken note of from the given feedback. As well as when jumping onto a different platform the player sprite would jump through the corner of the platform instead of being stopped, this is shown in the following GIF, (GIF 1).
Feedback:
Julia - “Nice work, jump movement feels good, but left right movement is slow, and I notice once the top of the box has cleared a platform, the rest of the box goes through it, is that intentional (totally fine if it is!)?”
Jordon – “Player movement feels a bit slow and when the top of the player is touching a platform you can jump mid-air”.
Improvements:
After receiving helpful feedback, I started looking of ways to improve/ fix problems. I discovered that the reason for a the corner cutting of the platforms is due to translate.position, because of not using rigid body movement commands in code the rigidBody2D component was delayed compared to the sprite. I decided to use rigidbody.velocity to fix this issue. I also added another command to set the velocity to zero when the movement keys were not pressed as the player did not stop instantly. I also added a material with zero friction to the collider2D component as the player stopped falling when being moved up against walls, this is shown below in Gif 2, Gif 3 shows the fixed solutions. I fixed the infinite jumps, I used code developed from (Lewis, 2023). I plan to try and create a new way to only jump once. I have also increased the speed of the player as the helpful feedback made me realised it needed to be increased.
References:
Lewis, I., 2023. 2023-04-19 11-00-18_KIT109_Live-Coding Platformer. [Online] Available at: https://echo360.net.au/media/da7cb035-3551-486a-a71f-7247fe306327/public [Accessed April 2023].
Ghost Escape
More posts
- DEVLOG - TestingMay 28, 2023
- Documentation + User guideMay 26, 2023
- DEVLOG - UI/PolishMay 21, 2023
- Test SurveyMay 17, 2023
- DEVLOG - Presentation / GraphicsMay 14, 2023
- DEVLOG - EnemiesMay 07, 2023
- DEVLOG - Basic level blockingApr 30, 2023
- Assignment 2-Game conceptApr 14, 2023
Leave a comment
Log in with itch.io to leave a comment.