RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[GM] Animation Troubles - FoxEngine 1.1

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 90
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.
« Last Edit: March 04, 2014, 01:49:22 AM by modern algebra »

********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
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.