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
when gf clicked Forever if <key [down arrow] pressed?> switch to costume [ costume2] else switch to costume [costume1] End EndBTW, welcome to scratch! Have you visited the new scratchers forum?
Last edited by hello12345678910 (2012-01-28 13:17:26)
Offline
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!!
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!
Offline
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.
Offline
There's loads of ways of doing this 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)
Offline
you need a
next costumeblock.
Offline
RedRocker227 wrote:
There's loads of ways of doing this 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 EndBTW, 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.
Fixed above.
Offline