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

#1 2013-02-14 01:27:42

Bombguy2010
New Scratcher
Registered: 2013-02-08
Posts: 17

How do you switch to a still costume when you are not moving

I want my character to switch to a still costume when it is not moving and using the "run costumes". I have tried if/else block however that doesn't work because it glitches up my "next costume" when i'm moving. I also don't want it to interfere with my other scripts (which change to other costumes) in the same character.

Thanks

Offline

 

#2 2013-02-14 05:16:03

Zelphase
New Scratcher
Registered: 2013-02-13
Posts: 24

Re: How do you switch to a still costume when you are not moving

Bombguy2010 wrote:

I want my character to switch to a still costume when it is not moving and using the "run costumes". I have tried if/else block however that doesn't work because it glitches up my "next costume" when i'm moving. I also don't want it to interfere with my other scripts (which change to other costumes) in the same character.

Thanks

An easy solution is this:

(if there is one run sprite)
Here, costume 2 = run sprite
         costume 1 = stand sprite

when gf clicked
forever
if <[x] pressed>
repeat [5]
point in direction [90]
switch to costume [2]
move [5] steps
wait [0.1] secs
switch to costume [1]
move [5] steps
else
say [ ]
However, if there are two run sprites to be used  when running:

Here, costume 1 = stand sprite
         costume 2 = run sprite (first)
         costume 3 = run sprite (second)


when gf clicked
forever
if 
[x] pressed
repeat [5]
point in direction [90]
switch to costume [2]
move [3.33] steps
wait [0.1] secs
switch to costume [3]
move [3.33] steps
wait [0.1] secs
switch to costume [1]
move [3.33] steps
else
say [ ]
Here, 'x' has to be replaced by whichever key is to be pressed to move right.
To move left, another key is to be set, except
 point in direction [90] 
is to be replaced with
 point in direction [-90] 

Offline

 

#3 2013-02-15 00:38:45

Bombguy2010
New Scratcher
Registered: 2013-02-08
Posts: 17

Re: How do you switch to a still costume when you are not moving

I have many run sprites (6-7) what do i do?

Offline

 

#4 2013-02-16 08:56:29

Zelphase
New Scratcher
Registered: 2013-02-13
Posts: 24

Re: How do you switch to a still costume when you are not moving

Bombguy2010 wrote:

I have many run sprites (6-7) what do i do?

In that case, either use just one or two run costumes OR  do this :-

when gf clicked
switch to costume [1]
forever
if <key [x v] pressed?>
point in direction [90]
switch to costume [2]
move [1.5] steps
wait [0.1] secs
switch to costume [3]
move [1.5] steps
wait [0.1] secs
switch to costume [4]
move [1.5] steps
wait [0.1] secs
switch to costume [5]
move [1.5] steps
wait [0.1] secs
switch to costume [6]
move [1.5] steps
wait [0.1] secs
switch to costume [7]
move [1.5] steps
wait [0.1] secs
switch to costume [1]
else
say [ ]
I hope that this helps you
Good Luck!
If you have more queries, feel free to ask!  smile

Offline

 

Board footer