I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: thefatkid22 on October 16, 2016, 10:10:06 PM

Title: Idle animation help
Post by: thefatkid22 on October 16, 2016, 10:10:06 PM
Hello,

I'm using that IWBT Studio Engine YoYoYo Edition v1_40 and I'm trying to change the idle animation as follows. I would like the initial idle animation to play through once then have it play on repeat a follow up idle animation that is subtly different. I am having a hard time figuring out the coding I've tried to use a while loop and an if else statement to try and replace the idle animation but I get the same problem with only one of the animations plays.

Please help if it's even possible.

Thanks,
Title: Re: Idle animation help
Post by: infern0man1 on October 16, 2016, 10:56:46 PM
This is what I would try:

Code: [Select]
//create
idle=false;

//step
if(sprite_index=[sprite you want to use for second animation]){
  idle=true;
}else{
  idle=false;
}
if(image_index=3 && idle!=true){
  sprite_index=[sprite you want to use for second animation];
}


Can't say for certain this will work, but it's worth a shot :4Head:
Title: Re: Idle animation help
Post by: thefatkid22 on October 17, 2016, 10:00:00 PM
Ok I tried that but all I am getting is animation 1.

Here's what I have under the Player object:

Code: [Select]
//step
  if(sprite_index=sprPlayerStand){
       
        idle = true;
  }else{
        idle = false;
  }     
  if(image_index =3 && idle != true){
    sprite_index = sprPlayerStand;
  }
    sprite_index = sprPlayerIdle;
    image_speed = 0.2;


and i have the idle variable set in the //create set to false.