Discuss Scratch

BosenChang
Scratcher
1000+ posts

Copy codes

What would have been cool is this:
control :: control :: hat // what this block is going to be
tell [sprite v] and myself to {
}::control
An example of where that would happen is this:
when green flag clicked
tell [sprite v] and myself to {
move (10) steps::motion
}::control
So what would happen is that the original sprite and the used sprite would be using the same code.
To prevent this from using the original code, use:
tell [sprite v] to {
}::control
NOTE:
THE ORIGINAL IDEA OF
tell [sprite v] to {
}::control
THIS WAS AN IDEA FROM –explosion–
Credit to –explosion– for this idea.
NOTE: THIS BLOCK IS IN
control::control :: hat
Problem detected sprite 1
when green flag clicked
tell [sprite2 v] to {
go to [sprite2 v] // actually, 3.0 has
go to (join [sprite1][])
}::control
This will select sprite2 to go to sprite1.

Last edited by BosenChang (Aug. 11, 2020 17:25:50)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
--Explosion--
Scratcher
1000+ posts

Copy codes

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll

Last edited by kaj (Tomorrow 00:00:00)
✰✩✭✴★--Explosion--★✴✭✩✰
Forum helper | boy | platformers | 14yrs | guitar | website


TheColaber
Scratcher
500+ posts

Copy codes

--Explosion-- wrote:

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll
A simple work around for this is to just broadcast…
broadcast [sprite1 commands v]
when I receive [sprite1 commands v]
move (10) steps

BosenChang
Scratcher
1000+ posts

Copy codes

--Explosion-- wrote:

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll
You are right…

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

TheColaber wrote:

--Explosion-- wrote:

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll
A simple work around for this is to just broadcast…
broadcast [sprite1 commands v]
when I receive [sprite1 commands v]
move (10) steps
Yes, but it would take longer. This is a useful shortcut.

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
TheColaber
Scratcher
500+ posts

Copy codes

BosenChang wrote:

TheColaber wrote:

--Explosion-- wrote:

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll
A simple work around for this is to just broadcast…
broadcast [sprite1 commands v]
when I receive [sprite1 commands v]
move (10) steps
Yes, but it would take longer. This is a useful shortcut.
not that long… it is just one extra block…

BosenChang
Scratcher
1000+ posts

Copy codes

BosenChang wrote:

TheColaber wrote:

--Explosion-- wrote:

How about this?
tell [sprite1 v] to {
move (10) steps::motion
}::controll
A simple work around for this is to just broadcast…
broadcast [sprite1 commands v]
when I receive [sprite1 commands v]
move (10) steps
Yes, but it would take longer. This is a useful shortcut.
And what I meant by that is e.g., you might have a lot. Then you have to get all that code into another sprite.
I believe @–Explosion– idea is good. Like
tell [sprite1 v] to {
move (10) steps::motion
}::controll
tell [sprite1 v] to {
say [ahh!]
}::controll :: loop
I added a loop

Last edited by BosenChang (June 19, 2020 16:34:52)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

And even:
tell [sprite1 v] and myself to {
move (10) steps::motion
}::controll

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

tell [sprite1 v] to {
move (10) steps::motion
}::controll
tell [sprite1 v] and myself to {
point in direction (90 v)::motion
}::controll
I hope this helps a lot

Last edited by BosenChang (June 19, 2020 16:21:02)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
Nambaseking01
Scratcher
1000+ posts

Copy codes

BosenChang wrote:

And what I meant by that is e.g., you might have a lot. Then you have to get all that code into another sprite.

Duplicating code and the backpack exists to move codes over.

Hey there! My name is Nammy. I'm a male Forum Helper and Scratch Wiki Editor.
Profile | Test Account | Talk with me here! | Griffpatch is quitting Scratch?!
BosenChang
Scratcher
1000+ posts

Copy codes

Nambaseking01 wrote:

BosenChang wrote:

And what I meant by that is e.g., you might have a lot. Then you have to get all that code into another sprite.

Duplicating code and the backpack exists to move codes over.
Excuse me! This is a faster work, if you do not want to boardcast. You need a name for the bordcast, but with this
tell [sprite1 v] to {
}::control
you may select the sprite. You can even wait until you give that code:
when green flag clicked
wait [2] secs
if <(pick random (1) to (2)) = [1]> then
tell [sprite1 v] to {
move (10) steps
}::control
or
tell [sprite1 v] and myself to {
point towards [sprite2 v]
}::control
end

Last edited by BosenChang (June 19, 2020 18:45:10)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
fdreerf
Scratcher
1000+ posts

Copy codes

This just defeats the purpose of a broadcast.
If this were to be added, what would be the point of broadcasts?
Since broadcasts are already added, what is the point of this?

Hyped for MS-DOS 11.0
--Explosion--
Scratcher
1000+ posts

Copy codes

BosenChang wrote:

Nambaseking01 wrote:

BosenChang wrote:

And what I meant by that is e.g., you might have a lot. Then you have to get all that code into another sprite.

Duplicating code and the backpack exists to move codes over.
Excuse me! This is a faster work, if you do not want to boardcast. You need a name for the bordcast, but with this
tell [sprite1 v] to {
}::control
Although the workaround is fairly simple the block I suggested would help with the organization of code greatly, it would also be usefull for games like scrolling platformers where the ground needs to move and a tick broadcast can cause bugs.
When using broadcasts they're also slower if you use the broadcast and wait block and although faster if you just use the regular broadcast the code from the two sprites may not run at the same time causing jittering and possible glitches. That is why I suggested this.
In addition, this block would enable much more precision with the timing of your code without actually making like 20 broadcasts to do the same thing.
Last but not least this block would be incredibly usefull in layering sprites.

Last edited by kaj (Tomorrow 00:00:00)
✰✩✭✴★--Explosion--★✴✭✩✰
Forum helper | boy | platformers | 14yrs | guitar | website


--Explosion--
Scratcher
1000+ posts

Copy codes

Nambaseking01 wrote:

BosenChang wrote:

And what I meant by that is e.g., you might have a lot. Then you have to get all that code into another sprite.

Duplicating code and the backpack exists to move codes over.
[offtopic]Don't you think it's much easier to just drag the code over the sprite in question's icon? Backpacking it makes the backpack cluttered and also is more time consuming…[/offtopic]

Last edited by --Explosion-- (June 19, 2020 17:38:48)


Last edited by kaj (Tomorrow 00:00:00)
✰✩✭✴★--Explosion--★✴✭✩✰
Forum helper | boy | platformers | 14yrs | guitar | website


BosenChang
Scratcher
1000+ posts

Copy codes

I have just realized that
tell [sprite1 v] to {
}::control
tell [sprite1 v] and myself to {
}::control
are similar to
if <> then

end
if <> then



else

end

Last edited by BosenChang (June 19, 2020 17:59:11)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

That block
tell [sprite1 v] to {
}::control
will skip that part, but
tell [sprite1 v] and myself to {
}::control
will make the user sprite not skip it. In addition both the blocks actually include the backdrops too.

Last edited by BosenChang (June 19, 2020 17:53:19)


Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

If it has a block that the stage is not supposed to have, the stage will completely ignore it.

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

Example:
when green flag clicked
tell [backdrop1 v] and myself to {
hide
wait (2) secs
show
}::control
say [hello] for (2) secs
Since the stage does not have show and hide, simply putting that in does not effect the stage.

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
BosenChang
Scratcher
1000+ posts

Copy codes

when green flag clicked
wait (1) secs
tell [sprite1 v] and myself to {
say [hi]
}::control

Last edited by kaj (The day after tomorrow 01:01:01)
Tomatoes are salty? I didn't know that!
Be moist
(-!*o_o*!-) // protecty, my signature kumquat protector. *power level: infinty *magic level: infinty
(?-i_i-?) // claculately, caculates weaknesses and finds out strengths to...
// evil qumquats



My signature change:
Some people don't have empathy; while others do.
Some people false-report projects, and more necropost.

Hello there! I can sometimes help you, or you can help me!


See my projects
I am not advertising. This is a signature. It appers underneath everything I write! To change your signature, go to Discussion Home and scroll down to “change my signature.”
see my projects::looks
say [hello]
If you want to see my topic “What makes a good topic?”, then go to Which topics are good?
Other helpful:
Lists of suggestions by SSB20 *please call him by his nickname*
Which topics are good? (already included) by me
--Explosion--
Scratcher
1000+ posts

Copy codes

BosenChang wrote:

when green flag clicked
wait (1) secs
tell [sprite1 v] and myself to {
say [hi]
}::control
I don't think the “tell ___ and myself” block is necessary, that block without the myself in there does the job.

Last edited by kaj (Tomorrow 00:00:00)
✰✩✭✴★--Explosion--★✴✭✩✰
Forum helper | boy | platformers | 14yrs | guitar | website


Powered by DjangoBB