Author Topic: Idle animation help  (Read 1342 times)

thefatkid22

  • Wannabe
  • Posts: 2
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Firefox 49.0 Firefox 49.0
    • View Profile
  • Playstyle: Keyboard
Idle animation help
« 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,

infern0man1

  • ~(=^・ω・^)ψ
  • Global Moderator
  • Oatmeal Killer
  • Posts: 1.021
  • Dear sir stroke madam, fire exclamation point
  • OS:
  • Unknown Unknown
  • Browser:
  • Chrome 53.0.2785.154 Chrome 53.0.2785.154
    • View Profile
    • Twitter
  • Playstyle: Keyboard
Re: Idle animation help
« Reply #1 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:

thefatkid22

  • Wannabe
  • Posts: 2
  • OS:
  • Windows 10 Windows 10
  • Browser:
  • Firefox 49.0 Firefox 49.0
    • View Profile
  • Playstyle: Keyboard
Re: Idle animation help
« Reply #2 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.