Discuss Scratch

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”.

About me
Registered: (mm/dd/yyyy) 07-07-2013
Scratcher
BEST QUOTE BY FAR: “No wristbands can make one.”
Best project worth checkin' out: //scratch.mit.edu/projects/12152860/
I wish there was an bbcode tag
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
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

ProdigyZeta7 wrote:

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
when 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?

About me
Registered: (mm/dd/yyyy) 07-07-2013
Scratcher
BEST QUOTE BY FAR: “No wristbands can make one.”
Best project worth checkin' out: //scratch.mit.edu/projects/12152860/
I wish there was an bbcode tag
ProdigyZeta7
Scratcher
1000+ posts

Problems with Scratch 1.4's blocks

emd245 wrote:

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?
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:
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

emd245 wrote:

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”.
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).

SDS Curator
Have a question? Ask me on my profile! I will be happy to answer them.
-What is an SDS curator? | How do I become an SDS curator? | Where can I get to your profile?-
drmcw
Scratcher
1000+ posts

Problems with Scratch 1.4's blocks

joletole wrote:

emd245 wrote:

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”.
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).

Because they want to use Scratch offline?

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
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

About me
Registered: (mm/dd/yyyy) 07-07-2013
Scratcher
BEST QUOTE BY FAR: “No wristbands can make one.”
Best project worth checkin' out: //scratch.mit.edu/projects/12152860/
I wish there was an bbcode tag
scimonster
Scratcher
1000+ posts

Problems with Scratch 1.4's blocks

emd245 wrote:

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
For the same reason as above: division by 0.

Retired Community Moderator
BTW, i run Google Chrome 41.0.2272.101 on a Linux system - Ubuntu 14.04. NEW: iPad 4th gen. w/retina.

418 I'm a teapot (original - to be read by bored computer geeks)
THE GAME (you just lost)
; THE SEMICOLON LIVES ON IN OUR SIGS

Powered by DjangoBB