Author Topic: Animation Troubles - FoxEngine 1.1  (Read 487 times)

0 Members and 1 Guest are viewing this topic.
purifier Male
**
Rep: +2/-1
Offline Offline
Level 70 (81%)
Animation Troubles - FoxEngine 1.1
« on: March 25, 2007, 07:39:05 PM »

  • 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.
    Arrow-1 Male
    *
    Capcom All Staff
    Rep: +269/-192
    Offline Offline
    Level 79 (91%)
    MEGA MAN X
    Re: Animation Troubles - FoxEngine 1.1
    « Reply #1 on: March 25, 2007, 09:28:54 PM »

  • 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.
     

    hi

    RMRK.net Theme Super Ultra Mega Beta

    Follow RMRK on Twitter Ask RMRK Questions on Formspring Get RMRK Updates via Windows Live

    Page created in 0.094 seconds with 19 queries.