Thursday, 26 May 2016

Class 63 - More Dodging

Post 145

More Dodging 

This class I am going to try and create a dodge roll for the player. My first step was adding the new control button inside my player controls. The reason I have this is in case I feel the need to change the controls for my game. This allows me to go through at any point in time and change it to what I want.


My next step is actually creating the script page for the dodge.


My next step was throwing in some directional detection. Basically what that means is I used a old variable that I haven't needed for a long time. This Variable is called "Idle" it determines what direction my character is facing. I use it to change the sprite to the correct direction when the player is moving in said direction. Obviously this makes the game feel way better.
After doing some testing I realized this wont be good enough because the movement code is constantly messing with the sprite index of the player, this makes it impossible to change the sprite index. After a little bit of tweaking I added in a new variable called "dodging". What this new variable will do is make it when the player is dodging the movement code is irrelevant. This helps on a lot of levels because now the player cant change the direction of their dodge half way into their dodge. It also gives me a variable that I can use to alter the damage effects on a dodging player.
There are still some major issues with this mechanic currently. The biggest issue being once the "dodging" variable is set to true there is no way to have it reset. So basically in the current state once you dodge you get stuck in a endless loop of rolling away. But there is a good side to all this. It looks cool.

Also after seeing what the dodge looks like on a moving character I think it should probably move a little bit faster.
Tomorrow I will further the code and possibly make the dodge animation faster to match the speed.


No comments:

Post a Comment