Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Is this the simplest way to go to a previous costume?
- lundfamily3
-
Scratcher
100+ posts
Is this the simplest way to go to a previous costume?
Is it?
when [left arrow v] key pressed
switch costume to ((costume #) - (1))
Last edited by lundfamily3 (Nov. 12, 2013 23:56:22)
- scubajerry
-
Scratcher
1000+ posts
Is this the simplest way to go to a previous costume?
Yes - I believe it is.
- PullJosh
-
Scratcher
1000+ posts
Is this the simplest way to go to a previous costume?
Yep. Switching backdrops is easier, for whatever reason, but this is it for costumes.
- lafoudre
-
Scratcher
100+ posts
Is this the simplest way to go to a previous costume?
The add and subtract are done “modulo” the number of costumes. If you do -1 on the first costume it goes to the last one ;-)
- KermitMC
-
Scratcher
100+ posts
Is this the simplest way to go to a previous costume?
There is an easier way yet it requires you knowing how many costumes are on the sprite.
If there are 7 costumes then make it change by 6.
Or if there is 5 costumes make it change by 4 ect.
If there are 7 costumes then make it change by 6.
Or if there is 5 costumes make it change by 4 ect.
- sonicfan12p
-
Scratcher
1000+ posts
Is this the simplest way to go to a previous costume?
There is an easier way yet it requires you knowing how many costumes are on the sprite.The script would look like this.
If there are 7 costumes then make it change by 6.
Or if there is 5 costumes make it change by 4 ect.
when [left arrow v] key pressedI don't know, that doesn't really seem easier, and it's also not future proof. If you add a costume, you have to change the number.
repeat [4]
next costume
Last edited by sonicfan12p (Nov. 13, 2013 20:57:53)
- Julianthewiki
-
Scratcher
100+ posts
Is this the simplest way to go to a previous costume?
Or, this:
switch costume to (join [costume]((costume #)-(1)))
Last edited by Julianthewiki (May 26, 2014 03:57:31)
- Discussion Forums
- » Help with Scripts
-
» Is this the simplest way to go to a previous costume?