Discuss Scratch
- Discussion Forums
- » Suggestions
- » Ultimate List of Workarounds And More
- noogai34
-
46 posts
Ultimate List of Workarounds And More
For those who want a workaround for
<[Broadcast v]?>use
when gf clickedand
set [YeetRecieved? v] to [0]
broadcast [yeet v]
when I receive [yeet v]
set [YeetRecieved? v] to [1]
<(YeetRecieved?) = (1)>is your
<[Broadcast v]?>
Last edited by noogai34 (April 28, 2019 15:15:52)
- ronsid
-
100+ posts
Ultimate List of Workarounds And More
for the
set pen color to hex input []::penyou can use
define set pen color to hex input [hex]
set pen color to (join [0x] (hex))
- --Explosion--
-
1000+ posts
Ultimate List of Workarounds And More
This is totally wrong…I think that…whoops, fixed it!Wait why does the custom block have two ‘true’?I put it into a custom block: You should fix the Leap Year workarounddefine (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]>>>
Leap years are every 4 years canr you jist do year mod 4
I'm just dumb like thatdefine (year) is a leap year?would be better.
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]
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?
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…
- BD10355
-
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
- Shaymin524
-
68 posts
Ultimate List of Workarounds And More
Use 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
if <(y position) > [180]> then
if on edge, bounce
end
change y position and 180 for whichever side you need.
- BD10355
-
14 posts
Ultimate List of Workarounds And More
Use 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, bounceif <(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!]
- Einstein102
-
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
-
68 posts
Ultimate List of Workarounds And More
ywUse 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, bounceif <(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!]
- Discussion Forums
- » Suggestions
-
» Ultimate List of Workarounds And More