Friday, 13 May 2016

Class 55 - Animated Blocking

Post 137

Animated Blocking

So I started the class off by changing a minor mistake from my last post. The fix was just a small difference between the size of the players sword when hes moving left and right.
- I just went back to transfer the old GIF here to point out the flaws. But I guess the GIF never saved, because its not there.
So here is the new and improved version that is far better.


I also started on making the blocking animation look more polished. I did this by having the shield actually have a moving motion when you use it.

The next thing I need to do with this is make it so once the animation plays it stops at the last frame.
This turned out to be very simple and just required some basic code

if (keyboard_check(ord(obj_player.button_block)))
{    
    image_speed = 1
    sprite_index = spr_player_1_block
    blockready = false;
    speed = 0;
    moveable = false
    //blocking = true
    if image_index > 5-1 
    {
        blocking = true
        image_speed = 0
    }
}

if (keyboard_check_released(ord(obj_player.button_block)))
{
blocking = false
moveable = true
image_blend = c_white
alarm[4] = 30;
blockready = true
}

The red text is the code I had to add to my existing blocking code.
Next class I think I will work on drinking health potions and possibly add an animation for picking things up, and using them.



No comments:

Post a Comment