Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Previous costume block
- Zeppry
-
1 post
Previous costume block
There is no previous costume block, but there is a way to do it. Just get a subtract block under operators, and put in the first spot the costume # block from looks, and type 1 in the other space.
- mstone326
-
1000+ posts
Previous costume block
Yup, use an operator block and switch costume to costume # - 1. I tried to do the scratch blocks but I'm terrible at those things.
Last edited by mstone326 (Oct. 5, 2017 23:08:33)
- Charles12310
-
1000+ posts
Previous costume block
Yup, use an operator block and switch costume to costume # - 1. I tried to do the scratch blocks but I'm terrible at those things.
define previous costume
switch costume to ((costume #) - (1))
This includes:
define next costume
switch costume to ((costume #) + (1))
Last edited by Charles12310 (Oct. 6, 2017 00:06:03)
- gtoal
-
1000+ posts
Previous costume block
Doesnt work for costume 0 unless you do tricks with the mod operator and the list size, being careful with the 0/1 offset issue…
- Charles12310
-
1000+ posts
Previous costume block
Doesn't costume 0 actually report the costume of maximum #? Doesnt work for costume 0 unless you do tricks with the mod operator and the list size, being careful with the 0/1 offset issue…
Last edited by Charles12310 (Oct. 6, 2017 00:53:06)
- Scratch-Minion
-
1000+ posts
Previous costume block
Yup, use an operator block and switch costume to costume # - 1. I tried to do the scratch blocks but I'm terrible at those things.switch costume to ((costume #) - (1))
This works fine!
It just sets the previous costume before the first costume to the last costume.
I have used it in many projects.
- asivi
-
1000+ posts
Previous costume block
It is posible to do this:
And, of course, do not name any costume “previous costume” or “next costume”
switch costume to (join [] [previous costume])//just set the first input blank(empty)
switch costume to (join [] [next costume])
And, of course, do not name any costume “previous costume” or “next costume”

Last edited by asivi (Oct. 6, 2017 04:04:04)
- Charles12310
-
1000+ posts
Previous costume block
Also imagine if you named a costume “1” and it isn't “#1”. It is posible to do this:switch costume to (join [] [previous costume])//just set the first input blank(empty)
switch costume to (join [] [next costume])
And, of course, do not name any costume “previous costume” or “next costume”
What would happen if you use this?
switch costume to (join [1][])
Will it lead to the costume called 1 or costume #1?
- asivi
-
1000+ posts
Previous costume block
Also imagine if you named a costume “1” and it isn't “#1”. It is posible to do this:switch costume to (join [] [previous costume])//just set the first input blank(empty)
switch costume to (join [] [next costume])
And, of course, do not name any costume “previous costume” or “next costume”
What would happen if you use this?switch costume to (join [1][])
Will it lead to the costume called 1 or costume #1?
You do your test

- asivi
-
1000+ posts
Previous costume block
An advice, you do not use numbers when naming costumes because it could confuse stuffs.
https://scratch.mit.edu/projects/159757516/
Since the OP is not asking anything i shall report this topic and ask to close it.
https://scratch.mit.edu/projects/159757516/
There is no previous costume block, but there is a way to do it. Just get a subtract block under operators, and put in the first spot the costume # block from looks, and type 1 in the other space.
Since the OP is not asking anything i shall report this topic and ask to close it.
- scratchcode1000
-
21 posts
Previous costume block
Also imagine if you named a costume “1” and it isn't “#1”. It is posible to do this:switch costume to (join [] [previous costume])//just set the first input blank(empty)
switch costume to (join [] [next costume])
And, of course, do not name any costume “previous costume” or “next costume”
What would happen if you use this?switch costume to (join [1][])
Will it lead to the costume called 1 or costume #1?
well folks you do it like this

(var)
switch costume to (var) // you drag the var on the thing where you can switch the costume ! :)
(var) // this variable will indicates the costume # what it should switch on
so you should do this
define previous costume
set [var v] to (costume #) // You drag the costume # variable here
change [var v] by (-1)
switch costume to (var)
you could also do it like this.
define previous costumeor
switch costume to ((costume #) + (-1))
define previous costumeyou can also do this whit scripts like
switch backdrop to ((costume #) - (1))
play sound (var)
play sound (var) until done
<touching (var) ?>
(distance to (var))
(video [movement v] on (var))
([x - location v] of (var))
also if you use hacked blocks you can also
when (var) > (10)
when (var) key pressed
// But keep in mind these /\ when scripts maybe don't work so do
when [var v] > (10)
// This /\ works better
((var) of [Sprite1 v])
// but it might have the same prob so do \/
([var v] of [Sprite1 v])
//you can do this also \/
when I receive (var)
// but don't write this time the thing like \/ instead like this <-
when I receive [var v]
see ye!

Last edited by scratchcode1000 (Oct. 6, 2017 07:00:12)
- Discussion Forums
- » Help with Scripts
-
» Previous costume block