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

#1 2007-06-04 21:27:05

aramdonabedian
Scratcher
Registered: 2007-06-04
Posts: 3

costume change based on direction and key stroke

I'm currently animating a figure which walks up, left, right, and left.  He has  a gun and I want him to change costumes when he fires (space bar) so that if he's pointed left and fires he changes to a costume which shows him firing left.  When he's firing down he changes  costumes so that he looks like he's firing down.  I wish there was an "If"command which was based on direction (IE If pointed right and key-spacebar, wait 0, switch costume [fire right] wait .1, switch costume [face right].   Does this make any sense?

Offline

 

#2 2007-06-04 21:38:09

paulmedwal
Scratcher
Registered: 2007-03-09
Posts: 100+

Re: costume change based on direction and key stroke

check out this simple script http://scratch.mit.edu/projects/paulmedwalhelp/8890
Obviously, you need to use the "change costume" block instead of using the "say" block.

Paulmedwal

Last edited by paulmedwal (2007-06-04 21:46:19)


clutter.scratch.mit.edu Visit the Clutter site to create multi-scene stories and multi-level games with Scratch.

Offline

 

#3 2007-06-04 21:45:05

aramdonabedian
Scratcher
Registered: 2007-06-04
Posts: 3

Re: costume change based on direction and key stroke

I'm not  sure what the Say command has to do with it

Offline

 

#4 2007-06-04 21:47:42

paulmedwal
Scratcher
Registered: 2007-03-09
Posts: 100+

Re: costume change based on direction and key stroke

Where the  "say" block is is where you need to put the "wait 0, switch costume [fire right] wait .1, switch costume [face right]" or whatever code you want to use when the space is pressed.

Paulmedwal

Last edited by paulmedwal (2007-06-04 21:48:14)


clutter.scratch.mit.edu Visit the Clutter site to create multi-scene stories and multi-level games with Scratch.

Offline

 

#5 2007-06-04 21:58:59

aramdonabedian
Scratcher
Registered: 2007-06-04
Posts: 3

Re: costume change based on direction and key stroke

Thanks a bunch!  It totally worked!  I'll put upload it  in a bit!

Offline

 

Board footer