Discuss Scratch

noogai34
Scratcher
46 posts

Ultimate List of Workarounds And More

For those who want a workaround for
<[Broadcast v]?>
use
when gf clicked
set [YeetRecieved? v] to [0]
broadcast [yeet v]
when I receive [yeet v]
set [YeetRecieved? v] to [1]
and
<(YeetRecieved?) = (1)>
is your
<[Broadcast v]?>

Last edited by noogai34 (April 28, 2019 15:15:52)


S U C C
ronsid
Scratcher
100+ posts

Ultimate List of Workarounds And More

for the
set pen color to hex input []::pen
you can use
define set pen color to hex input [hex]
set pen color to (join [0x] (hex))

This siggy is protected by the Antiquat group
when green flag clicked
say [Scratch Time] for (2) secs
broadcast [funtime v]
when I receive [funtime v]
say [ Yaay] for (2) secs
--Explosion--
Scratcher
1000+ posts

Ultimate List of Workarounds And More

MathlyCat wrote:

dvargasews wrote:

alexphan wrote:

MathlyCat wrote:

alexphan wrote:

MathlyCat wrote:

You should fix the Leap Year workaround
I put it into a custom block:
define (year) is a leap year?
set [leap year v] to [false]
if <((year) mod (4)) = [0]> then
if <((year) mod (100)) = [0]> then
if <((year) mod (400)) = [0]> then
set [leap year v] to [true]
else
set [leap year v] to [false]
end
else
set [leap year v] to [true]
end
else
stop [this script v]
end

…or as a boolean:

<<((year) mod (4)) = [0]> or <<((year) mod (100)) = [0]> and <((year) mod (400)) = [0]>>>
Wait why does the custom block have two ‘true’?
…whoops, fixed it!
Leap years are every 4 years canr you jist do year mod 4
I'm just dumb like that
I think that
define (year) is a leap year?
if <((year) mod (4)) = [0]> then
if <((year) mod (100)) = [0]> then
if <((year) mod (400)) = [0]> then
set [leap year v] to [true]
else
set [leap year v] to [false]
end
else
set [leap year v] to [true]
end
else
set [leap year v] to [false]
end
stop [this script v]
would be better.
For Boolean, I think that the correct version is
<<((year) mod (4)) = [0]> and <<not <((year) mod (100)) = [0]>> or <((year) mod (400)) = [0]>>>
but maybe someone else could check it?
This is totally wrong…

Leap Years are every 4 years, and so they work by mod 400, but for that to work you also need to mod 4 and 100.

You overcomplicate the custom block which was best as alexphan had it, and the reporter is wrong…

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


BD10355
Scratcher
14 posts

Ultimate List of Workarounds And More

Could you make a workaround that senses if the sprite touches a specific side of the screen? Thx. It might look like this.
if on top edge, bounce

Signed,
BD10355
pen up
Shaymin524
Scratcher
68 posts

Ultimate List of Workarounds And More

BD10355 wrote:

Could you make a workaround that senses if the sprite touches a specific side of the screen? Thx. It might look like this.
if on top edge, bounce
Use
if <(y position) > [180]> then
if on edge, bounce
end

change y position and 180 for whichever side you need.

—————————————————————————

GENERATION 1: When you first see this copy it to the start of your sig and change Generation by 1.

—————

Bring back remix trees, scroll blocks, picoboards and the discuss tab!

—————

Trans girl / Lesbian / 13 / Libra
BD10355
Scratcher
14 posts

Ultimate List of Workarounds And More

Shaymin524 wrote:

BD10355 wrote:

Could you make a workaround that senses if the sprite touches a specific side of the screen? Thx. It might look like this.
if on top edge, bounce
Use
if <(y position) > [180]> then
if on edge, bounce
end

change y position and 180 for whichever side you need.

Thank you!
say [You r de best Shaymin524!]

Signed,
BD10355
pen up
Einstein102
Scratcher
1 post

Ultimate List of Workarounds And More

Ya I was working on a talking informational solar system model and I wanted to implement a little clicker game and once you got a certain amount of coins you could get new information about a planet. I also wanted the planets to move revolve around the sun and I wanted them to do it forever without a forever block so I used message blocks and it didnt work.
Shaymin524
Scratcher
68 posts

Ultimate List of Workarounds And More

BD10355 wrote:

Shaymin524 wrote:

BD10355 wrote:

Could you make a workaround that senses if the sprite touches a specific side of the screen? Thx. It might look like this.
if on top edge, bounce
Use
if <(y position) > [180]> then
if on edge, bounce
end

change y position and 180 for whichever side you need.

Thank you!
say [You r de best Shaymin524!]
yw

—————————————————————————

GENERATION 1: When you first see this copy it to the start of your sig and change Generation by 1.

—————

Bring back remix trees, scroll blocks, picoboards and the discuss tab!

—————

Trans girl / Lesbian / 13 / Libra
MathlyCat
Scratcher
1000+ posts

Ultimate List of Workarounds And More

Please Use:

https://scratch.mit.edu/discuss/topic/351925/

Think before you act.
Actions speek louder than words.

hi there fella

Powered by DjangoBB