Discuss Scratch

stevader11
New Scratcher
2 posts

Making My Sprite Aware of it's costume.

I'm working on a side-scroller right now, and have a bunch of costumes for walking, running, and jumping, facing right and left. However, I only have one choice as to the costume I want to use for jumping. It depends on whether the sprite is facing left (Left costume,) or facing right, (Right costume.)

Is there any way to make the costume my sprite changes into dependent on what costume he is in at the moment?


Thanks, Newbie Here.
manwithmanykids
Scratcher
67 posts

Making My Sprite Aware of it's costume.

I would track the costume in a variable, but then I am old school programmer
drmcw
Scratcher
1000+ posts

Making My Sprite Aware of it's costume.

It's already available in looks as “costume #”, so if costume# = 3 then switch to costume walk as an example.
turkey3
Scratcher
1000+ posts

Making My Sprite Aware of it's costume.

There are two solutions. You can set the sprite's rotation style to left-right and have it point left and right instead of having separate costumes for each direction. Or you can try the script for you in my scripts sandbox it's the second one.
stevader11
New Scratcher
2 posts

Making My Sprite Aware of it's costume.

Thanks all, especially Turkey3!
bob6
Scratcher
100+ posts

Making My Sprite Aware of it's costume.

You can also set a variable to have either “left” in it or “right” in it. This way when you walk left, change it into “left”, and vice versa; then, you can use this variable to determine which direction to point.

Powered by DjangoBB