Discuss Scratch

Zeppry
New Scratcher
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
Scratcher
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
Scratcher
1000+ posts

Previous costume block

mstone326 wrote:

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
Scratcher
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
Scratcher
1000+ posts

Previous costume block

gtoal wrote:

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…
Doesn't costume 0 actually report the costume of maximum #?

Last edited by Charles12310 (Oct. 6, 2017 00:53:06)

Scratch-Minion
Scratcher
1000+ posts

Previous costume block

Charles12310 wrote:

mstone326 wrote:

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.
78ch3
Scratcher
1000+ posts

Previous costume block

switch backdrop to [previous backdrop v]
asivi
Scratcher
1000+ posts

Previous costume block

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”

Last edited by asivi (Oct. 6, 2017 04:04:04)

Charles12310
Scratcher
1000+ posts

Previous costume block

asivi wrote:

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”
Also imagine if you named a costume “1” and it isn't “#1”.

What would happen if you use this?

switch costume to (join [1][])

Will it lead to the costume called 1 or costume #1?
asivi
Scratcher
1000+ posts

Previous costume block

Charles12310 wrote:

asivi wrote:

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”
Also imagine if you named a costume “1” and it isn't “#1”.

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
Scratcher
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/

Zeppry wrote:

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
Scratcher
21 posts

Previous costume block

Charles12310 wrote:

asivi wrote:

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”
Also imagine if you named a costume “1” and it isn't “#1”.

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 costume
switch costume to ((costume #) + (-1))
or
define previous costume
switch backdrop to ((costume #) - (1))
you can also do this whit scripts like
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)

Powered by DjangoBB