The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: purifier on March 26, 2007, 12:39:05 AM

Title: [GM] Animation Troubles - FoxEngine 1.1
Post by: purifier on March 26, 2007, 12:39:05 AM
Hey, I have a bit of a problem that I have tried to resolve several different ways, but I can't fix.

I have tried to make it so when the player presses <space> that it will show the slash sprite. Here is the code I am currently using to show the sprite:

Code: [Select]
if(keyboard_check(vk_space) && slashReady) {
    for(i = 0; i = 1; i += 1)
    {
        if(wspeed == 0 ) image_speed = (wspeed + 3) / 10;
        if(wspeed == 0 && sprite_index = spr_idle_right) sprite_index = spr_slash1_right;
        if(wspeed == 0 && sprite_index = spr_idle_left) sprite_index = spr_slash1_left;
    }
    slashReady = false;
    alarm[0] = 5;
}

I don't think I'm using the 'for' loop correctly. Anyway, I had managed to get it to half work, but you would still be able to move when you pressed space. I want the player stop when they slash.

I have tried many ways to get this to work, but I just can't. So if someone could be so kind to help I would be very thankful.
Title: Re: Animation Troubles - FoxEngine 1.1
Post by: Arrow on March 26, 2007, 02:28:54 AM
Well, what I would do is make a variable when the object is created called mobile, then aftter it's initialized, set it to 1. When the player is not supposed to move, set it to 0, and when they can move again, set it back to 1. Whenever a movement key is pressed, exit if that variable is not equal to one.