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

#1 2012-01-28 13:12:10

megnut99
New Scratcher
Registered: 2012-01-28
Posts: 7

Changing Costumes

I'm making a game and I want to have my sprite change to a costume while holding the down arrow key, and then changing back to it's original costume when the down arrow key is released. I just started using Scratch so maybe the answer is obvious but I would really appreciate any help! I'm trying to use this script but it only works at random times. Thanks in advance for any help!

[scratchblocks]
when down arrow key pressed
if [down arrow key pressed?]
switch to costume [ costume2]
else
switch to costume [costume1]

Offline

 

#2 2012-01-28 13:15:20

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Changing Costumes

when gf clicked
Forever
if <key [down arrow] pressed?>
switch to costume [ costume2]
else
switch to costume [costume1]
End
End
BTW, welcome to scratch! Have you visited the new scratchers forum?

Last edited by hello12345678910 (2012-01-28 13:17:26)


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#3 2012-01-28 13:17:56

megnut99
New Scratcher
Registered: 2012-01-28
Posts: 7

Re: Changing Costumes

sorry the script is

when down arrow key pressed
if <down arrow key pressed?>
switch to costume [costume2]
else
switch to costume [costume1]

Offline

 

#4 2012-01-28 13:21:37

megnut99
New Scratcher
Registered: 2012-01-28
Posts: 7

Re: Changing Costumes

oh forever ok thanks! i was missing that that makes sense.
And no I haven't visited! I barley know my way around. Thanks for helping me!!  smile

Offline

 

#5 2012-01-28 13:24:32

hello12345678910
Scratcher
Registered: 2009-07-11
Posts: 100+

Re: Changing Costumes

megnut99 wrote:

oh forever ok thanks! i was missing that that makes sense.
And no I haven't visited! I barley know my way around. Thanks for helping me!!  smile

Your welcome. Be sure to make your own topic and introduce yourself- there's a ton of people on scratch who love to have you here!


http://tinyurl.com/8yt32o9 http://tinyurl.com/6tgwp5r || Fish = F+I+S+H = 6+9+19+8 = 42<<The answer to Life, the Universe and Everything

Offline

 

#6 2012-01-28 15:34:33

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: Changing Costumes

when gf clicked
if <key down arrow pressed>
switch to costume [costume2]
wait until <not <key down arrow pressed>
switch to costume [costume1]
would also work.  smile

Offline

 

#7 2012-01-29 02:04:28

K-Jam
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: Changing Costumes

when gf clicked
forever
if <left arrow key pressed>
next costume
end
if <down key pressed>
switch to [costume 1]
end
end

Last edited by K-Jam (2012-01-29 02:04:52)


http://images.inmagine.com/img/imagezoo/iz162/Iz162012.jpg COMPASS!!!

Offline

 

#8 2012-01-29 03:50:46

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Changing Costumes

There's loads of ways of doing this  tongue  You could do what Hello12345678910 said, but that may cause some lag, since the script will be running constantly. If you want to minimise like, try this:

when [down arrow v] key pressed
repeat until <not <key [down arrow v] pressed>>
switch to costume [[Costume] v]
end
switch to costume [[Other costume] v]

Last edited by RedRocker227 (2012-01-29 04:00:15)


Why

Offline

 

#9 2012-05-18 13:59:51

bluecat600
Scratcher
Registered: 2012-02-12
Posts: 500+

Re: Changing Costumes

you need a

next costume
block.


I gaze off into the boundless skyline, noteblock choirs playin in the sunshine, turn round pick up my sword and wield the blade that once forced evil mobs to yield, if this battle shall leave me slain, I know Herobrine still calls my name, better just take a stand, that was when I ruled the land.

Offline

 

#10 2012-05-18 22:20:11

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Changing Costumes

RedRocker227 wrote:

There's loads of ways of doing this  tongue  You could do what Hello12345678910 said, but that may cause some lag, since the script will be running constantly. If you want to minimise like, try this:

when [down arrow v] key pressed
repeat until <not <key [down arrow v] pressed?> >
switch to costume [[Costume] v]
end
switch to costume [[Other costume] v]

hello12345678910 wrote:

when gf clicked
Forever
if <[down arrow v] key pressed?>
switch to costume [costume2 v]
else
switch to costume [costume1 v]
End
End
BTW, welcome to scratch! Have you visited the new scratchers forum?

a1130 wrote:

when gf clicked
if <[down arrow v] key pressed ?>
switch to costume [costume2 v]
wait until <not <[down arrow v] key pressed?> >
switch to costume [costume1 v]
would also work.  smile

Fixed above.


http://trinary.tk/images/signature_.php

Offline

 

Board footer