T
Triglaw
Guest
Hi everyone,
I'm currently working on rpg game where your character moves in 8 directions and he is facing and attacking based on the position of your mouse form the character. I also want to make the character block, but I cant make the code to block properly.
Here is how I want the block to work. When I activate block, the character can block 80% of the damage from his front side. Character's front side is from the center of the character to the mouse position at constant distance and 45° angle at both sides. I already have the sprite animation, block key/animation and the direction, but I cant make the code to reduce the damage by 80% if I block the damage and take full damage if I'm not blocking or the damage is coming form another direction.
Thank you in advance.
I'm currently working on rpg game where your character moves in 8 directions and he is facing and attacking based on the position of your mouse form the character. I also want to make the character block, but I cant make the code to block properly.
Here is how I want the block to work. When I activate block, the character can block 80% of the damage from his front side. Character's front side is from the center of the character to the mouse position at constant distance and 45° angle at both sides. I already have the sprite animation, block key/animation and the direction, but I cant make the code to reduce the damage by 80% if I block the damage and take full damage if I'm not blocking or the damage is coming form another direction.
Thank you in advance.