This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-03-22 12:47:58

brice2109
New Scratcher
Registered: 2013-03-19
Posts: 2

idle animation trouble

Hi everyone. i've been trying to make an idle animation that, after 20 seconds of inactivity, switches between two frames of idle images forever until one of the arrow keys is pressed, at which point it ends the script and returns to normal. Of course, i want the script to re-activate again after 20 seconds of inactivity. can anyone help?

Offline

 

#2 2013-03-22 13:20:55

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: idle animation trouble

Just to make sure, how many costumes/frames are there in your animation?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-03-22 14:11:45

brice2109
New Scratcher
Registered: 2013-03-19
Posts: 2

Re: idle animation trouble

just 2 idle costumes

repeat
switch to costume [idle 1]
wait [1] second
switch to costume [idle 2]
wait [1] second

Offline

 

#4 2013-03-22 16:23:39

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: idle animation trouble

Oh, ok. Well then here's a script that could help you:

when gf clicked
reset timer
forever
 if <(timer) > (19.9)>//Wait time
  reset timer
  next costume
 else 
  if <<(key [Up Arrow v] pressed?) or (key [Down Arrow v] pressed?)> or <(key [Left Arrow v] pressed?) or (key [Right Arrow v] pressed?)>>
   reset timer
   Normal action scripts...
  end
 end

I hope that this helps!

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer