Devlog - Player Movement
Devlog – Player Movement
The focus of this Devlog is to talk about the player movement. In a match-3 game, there is limited player movement which involves clicking on a tile or position and dragging that tile in a direction to indicate the direction that you would like to swap it. The game does the rest of the job of matching tiles and collapsing the columns. In this version of the game, I achieved this by the measuring two positions in the game, the position where the mouse is pressed down and the position of where the mouse is let up. It then does a trigonometric calculation to work out what they angle of the drag was. Depending on the angle, it will swap the selected tile with the one up, down, left or right of it (Figure 1).
Figure 1. Tiles being swapped.
Feedback
Feedback received at this moment in the game’s development indicated that there was a need for there to be some sort of animation for the tiles swapping with each other rather than them appearing at each other’s positions (Figure 1). This was achieved by adding a “lerp” function into the program which will move the selected game object x distance of y amount of time until it reaches it destination (Figure 2).
Figure 2. Tiles being swapped with animation.
There was also a bug in the game where if you clicked on a tile, e.g. you did not make an effort to move left or right, it would count it as a right move. This occurred in the game because the angle calculated from clicking in the same position was 0 (directly right) and an angle from 45 to -45 is counted as a right move. To overcome this problem, a distance requirement was added in order for a move to be recognized. So that if the distance between the two mouse points (down and up) are greater than 0, it counts as a move.
Files
KIT109 - Triple Slime
A Match 3 Puzzle game created for an University assignment
More posts
- Devlog - Documentation and User GuideMay 30, 2021
- Devlog - Updates / Planned Updates Based Upon The Testing SessionMay 19, 2021
- Devlog - User Interface / PolishMay 18, 2021
- Game Project TestingMay 18, 2021
- Devlog - Presentation / GraphicsMay 17, 2021
- Devlog - Enemies / Interactions / PuzzlesMay 09, 2021
- Devlog - Basic Level BlockingApr 28, 2021
- Game ConceptApr 21, 2021
Leave a comment
Log in with itch.io to leave a comment.