Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Problems with Scratch 1.4's blocks
- emd245
-
Scratcher
78 posts
Problems with Scratch 1.4's blocks
I used this script:
when (space v) key pressed
__________forever_______
|
|set (variable v) to ((mouse x) mod (mouse y))
|_______________________
and it turns dark red, because it's “invalid”.

when (space v) key pressed
__________forever_______
|
|set (variable v) to ((mouse x) mod (mouse y))
|_______________________
and it turns dark red, because it's “invalid”.

- ProdigyZeta7
-
Scratcher
1000+ posts
Problems with Scratch 1.4's blocks
It's because “mouse y” becomes 0, so it tries to divide by 0 and, well….
All you need to do is change the script to
All you need to do is change the script to
when gf clicked
forever
if <(mouse y) = 0>
…
else
set {variable v} to ((mouse x) mod (mouse y))
- emd245
-
Scratcher
78 posts
Problems with Scratch 1.4's blocks
It's because “mouse y” becomes 0, so it tries to divide by 0 and, well….
All you need to do is change the script towhen gf clicked
forever
if <(mouse y) = 0>
…
else
set {variable v} to ((mouse x) mod (mouse y))
O.K.. how about this:
when gf clicked
_______forever________
|go to x: (direction) y: (x position)
_____________________
Does this mean the sprite goes to, for example, 18 x and 18 y?
- ProdigyZeta7
-
Scratcher
1000+ posts
Problems with Scratch 1.4's blocks
O.K.. how about this:Well, no… actually it goes to the direction value for x and the original x position for y. Here's two possible methods for your idea:
when gf clicked
_______forever________
|go to x: (direction) y: (x position)
_____________________
Does this mean the sprite goes to, for example, 18 x and 18 y?
set x to (direction)
set y to (x position)
OR
go to x: (direction) y: (direction)
- joletole
-
Scratcher
100+ posts
Problems with Scratch 1.4's blocks
I used this script:The first question I have is why are you using 1.4. 1.4 doesn't have many of the features as 2.0 (I was there).
when (space v) key pressed
__________forever_______
|
|set (variable v) to ((mouse x) mod (mouse y))
|_______________________
and it turns dark red, because it's “invalid”.
- drmcw
-
Scratcher
1000+ posts
Problems with Scratch 1.4's blocks
I used this script:The first question I have is why are you using 1.4. 1.4 doesn't have many of the features as 2.0 (I was there).
when (space v) key pressed
__________forever_______
|
|set (variable v) to ((mouse x) mod (mouse y))
|_______________________
and it turns dark red, because it's “invalid”.
Because they want to use Scratch offline?
- Borrego6165
-
Scratcher
500+ posts
Problems with Scratch 1.4's blocks
I use it for pretty much the whole project, then I spice it up in 2.0 before release. I leave the 2.0 coding until the last minute. If I ever need a custom block or a clone I just leave a message at the side of the 1.4 code until I'm ready to do it in 2.0.
- emd245
-
Scratcher
78 posts
Problems with Scratch 1.4's blocks
Invalid Script
!?!?
when (space v) key pressed
go to x: (0) y: (0)
forever
change x by ((XY slider) / (pick random (-1) to (3))
change y by ((XY slider) / (pick random (-1) to (4))
end
!?!?
when (space v) key pressed
go to x: (0) y: (0)
forever
change x by ((XY slider) / (pick random (-1) to (3))
change y by ((XY slider) / (pick random (-1) to (4))
end
- scimonster
-
Scratcher
1000+ posts
Problems with Scratch 1.4's blocks
Invalid ScriptFor the same reason as above: division by 0.
!?!?
when (space v) key pressed
go to x: (0) y: (0)
forever
change x by ((XY slider) / (pick random (-1) to (3))
change y by ((XY slider) / (pick random (-1) to (4))
end
- Discussion Forums
- » Questions about Scratch
-
» Problems with Scratch 1.4's blocks
