This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-02-21 14:15:25

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Official [Scratchblocks] Testing Play Area

We seem to be getting a lot of spam posts from people new to the forums trying out the Scratchblock feature.  Maybe if we had a dedicated place for playing around with them, we could cut down on that some. 

So here it is - try out your script displaying skills here!

However, please do not turn this into a spam area.  Post until you are comfortable with the Scratchblock syntax and then stop.  Don't make ongoing stories or conversations here.

Last edited by Paddle2See (2012-03-25 08:54:37)


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#2 2012-02-21 14:19:41

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

A play area. :DDD

I've been meaning to test some more....

When Green Flag clicked
 :D

Last edited by CheeseMunchy (2012-02-21 14:35:29)


6418,

Offline

 

#3 2012-02-21 14:24:44

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Official [Scratchblocks] Testing Play Area

< <(variable1) > [5]> or <(variable1) = [5]> >

< <(variable1) > [5]> or <(variable1) = [5]> >
huh, this didn't work earlier...came up with some some weird text on a block.

Last edited by Smozzick (2012-02-21 14:25:35)


http://i50.tinypic.com/ded8m.png

Offline

 

#4 2012-02-21 16:12:49

laptop97
Scratcher
Registered: 2011-06-27
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

when gf clicked
set [var v] to (0)
Repeat until <(var) to (5)>
  change [var v] by (1)
end
say [Will this work?] for (4) secs
stop all

Last edited by laptop97 (2012-02-21 16:16:01)

Offline

 

#5 2012-02-21 16:18:47

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

There is already a place for this. I'll find the link.
EDIT: oops, paddle made this.

Last edited by samtwheels (2012-02-21 16:21:28)

Offline

 

#6 2012-02-21 16:22:26

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

when gf clicked
forever
say [oops!]
end
say [sorry paddle]

Last edited by samtwheels (2012-02-21 16:22:46)

Offline

 

#7 2012-02-21 16:23:25

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

samtwheels wrote:

There is already a place for this. I'll find the link.
EDIT: oops, paddle made this.

Actually, you're right about there being another place for this.
This page is officially advertised in the Announcements thread by JSO, and doesn't actually spam up the forums in any way!  smile

Offline

 

#8 2012-02-21 16:24:54

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

when I receive [Thread has been posted v]
say [Yay, a play area :DDDDDDDDDDDDDDD]


Why

Offline

 

#9 2012-02-21 16:27:16

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

samtwheels wrote:

There is already a place for this. I'll find the link.
EDIT: oops, paddle made this.

There is?  I know about JSO's plugin lab:

http://joren.tk/blocks/pluginlab.htm

but it seems to be a bit slow to respond and a lot of people seem to be missing it.  I thought I'd try this approach and see how it worked out  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#10 2012-02-21 16:32:05

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

LOLOLOL! You wouldn't think that an admin would make a thread for spamming the scratchblocks  tongue 

 
Obsolete!

Last edited by Mokat (2012-02-21 16:33:36)


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#11 2012-02-23 11:04:22

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

You can get a relatively good approximation by writing the project summary (shift-click File).

    when green flag clicked
        point in direction 90
        set "PlayerX" to "0"
        set "PlayerY" to "0"
        set "LevelNumber" to "1"
        set "Dir" to "0"
        set "Xvel" to "0"
        set "Yvel" to "0"
        forever  
            clear
            go to x: 0 y: 0
            switch to costume ((LevelNumber) + 1)
            stamp
            switch to costume "Marble"
            if ((Dir) = "0") else 
                go to x: ((PlayerX) * 30) y: ((PlayerY) * 30)
            else
                if ((Dir) = "1") else 
                    go to x: ((PlayerY) * 30) y: ((PlayerX) * -30)
                else
                    if ((Dir) = "2") else 
                        go to x: ((PlayerX) * -30) y: ((PlayerY) * -30)
                    else
                        go to x: ((PlayerY) * -30) y: ((PlayerX) * 30)
            stamp
            if (key "right arrow" pressed?) 
                switch to costume ((LevelNumber) + 1)
                go to x: 0 y: 0
                clear
                set "Dir" to (((Dir) + 1) mod 4)
                set "PlayerX" to (round (PlayerX))
                set "PlayerY" to (round (PlayerY))
                repeat 10  
                    turn  9 degrees
            if (key "left arrow" pressed?) 
                switch to costume ((LevelNumber) + 1)
                go to x: 0 y: 0
                clear
                set "Dir" to (((Dir) - 1) mod 4)
                set "PlayerX" to (round (PlayerX))
                set "PlayerY" to (round (PlayerY))
                repeat 10  
                    turn  -9 degrees
            if (((Dir) = "0") and ("0" = (letter ((((round (PlayerX)) + 0) + 4) + ((((round ((PlayerY) + 0.5)) + -1) - 3) * -7)) of (item (LevelNumber) of "LevelData" )))) 
                change "PlayerY" by -0.1
            if (((Dir) = "1") and ("0" = (letter ((((round ((PlayerX) - 0.5)) + 1) + 4) + ((((round ((PlayerY) + 0.5)) + 0) - 3) * -7)) of (item (LevelNumber) of "LevelData" )))) 
                change "PlayerX" by 0.1
            if (((Dir) = "2") and ("0" = (letter ((((round (PlayerX)) + 0) + 4) + ((((round ((PlayerY) - 0.5)) + 1) - 3) * -7)) of (item (LevelNumber) of "LevelData" )))) 
                change "PlayerY" by 0.1
            if (((Dir) = "3") and ("0" = (letter ((((round ((PlayerX) + 0.5)) + -1) + 4) + ((((round ((PlayerY) - 0.5)) + 0) - 3) * -7)) of (item (LevelNumber) of "LevelData" )))) 
                change "PlayerX" by -0.1
    end


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#12 2012-02-23 11:36:33

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

CheeseMunchy wrote:

(TestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesv)

(Lololololololololololololololololololololololololololololololololololololololololololololololololol)


Why

Offline

 

#13 2012-02-23 11:46:05

shiguy101
Scratcher
Registered: 2010-11-17
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

RedRocker227 wrote:

CheeseMunchy wrote:

(TestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesv)


(Lololololololololololololololololololololololololololololololololololololololololololololololololol)

when gf clicked
say [all aboard quote train!]
play sound[choo-choo] // :P

Offline

 

#14 2012-02-23 12:11:02

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

Hardmath123 wrote:

You can get a relatively good approximation by writing the project summary (shift-click File).

Good point! I didn't know that. This tip really helps if you don't want to type everything out word for word. You just have to fix some syntax problems. Here is the script for the "ball" sprite in the Sample Project "5 MarbleRacer".

This is what it looks like when I first copy and paste the script.

    when green flag clicked
        forever  
            if (key "up arrow" pressed?) 
                change "y velocity" by 0.02
            if (key "down arrow" pressed?) 
                change "y velocity" by -0.02
            if (key "left arrow" pressed?) 
                change "x velocity" by -0.02
            if (key "right arrow" pressed?) 
                change "x velocity" by 0.02
    end

    when green flag clicked
        forever  
            change x by (x velocity)
            change y by (y velocity)
    end

    when green flag clicked
        set "x velocity" to 0
        set "y velocity" to 0
        go to x: 183 y: -6
    end

    when green flag clicked
        forever if (touching color c[00CC44]?)  
            set "x velocity" to ((x velocity) * 0.95)
            set "y velocity" to ((y velocity) * 0.95)
    end

This is what it looks like when I fix it:

    when green flag clicked
        forever  
            if (key [up arrow v] pressed?) 
                change [y velocity v] by [0.02]
            end
            if (key [down arrow v] pressed?) 
                change [y velocity v] by [-0.02]
            end
            if (key [left arrow v] pressed?) 
                change [x velocity v] by [-0.02]
            end
            if (key [right arrow v] pressed?) 
                change [x velocity v] by [0.02]
            end

    when green flag clicked
        forever  
            change x by (x velocity)
            change y by (y velocity)

    when green flag clicked
        set [x velocity v] to [0]
        set [y velocity v] to [0]
        go to x: (183) y: (-6)

    when green flag clicked
        forever if (touching color [#00CC44]?)  
            set [x velocity v] to ((x velocity) * (0.95))
            set [y velocity v] to ((y velocity) * (0.95))

The first one still get's the point across, but the second one improves upon the syntax so the script looks more accurate.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#15 2012-02-23 13:34:20

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

Ooohhh, these posts gave me an idea... project summary to scratchblocks parser!!  big_smile

Offline

 

#16 2012-02-23 13:41:56

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: Official [Scratchblocks] Testing Play Area

People could just click preview to test around, but this will be good for the people who didn't think about that.

Offline

 

#17 2012-02-23 14:54:43

muppetds
Scratcher
Registered: 2011-02-11
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

RedRocker227 wrote:

CheeseMunchy wrote:

(TestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesv)

(Lololololololololololololololololololololololololololololololololololololololololololololololololol)

lol you can't scroll sideways    sad


SCRATCH'S PARTLY INSANE RESIDENT 
http://internetometer.com/imagesmall/31691.pnghttp://bluetetrarpg.x10.mx/usercard/?name=muppetds

Offline

 

#18 2012-02-23 15:10:35

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

 
when gf clicked
say [l;kajfg;iaj;idfgh;aurhrgpiuahye] for (5987) secs
play sound [pop v] until done
asihiahaiuhauhaisayotyyoataygaahiayhyyhyhyah47ty785yob 2bthub oiqboy 


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#19 2012-02-23 15:54:49

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

muppetds wrote:

RedRocker227 wrote:

CheeseMunchy wrote:

(TestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesTestingtestpicklesv)

(Lololololololololololololololololololololololololololololololololololololololololololololololololol)

lol you can't scroll sideways    sad

when I receive [Extremely good point v]
play sound [Grunt v]
say [Y U NO TALK IN SCRATCH BLOCKS?]


Why

Offline

 

#20 2012-02-23 16:42:07

mitchboy
Scratcher
Registered: 2011-11-29
Posts: 59

Re: Official [Scratchblocks] Testing Play Area

Hardmath123 wrote:

You can get a relatively good approximation by writing the project summary (shift-click File).

when green flag clicked
point in direction (90)
set [PlayerX v] to (0)
set [PlayerY v] to (0)
set [LevelNumber v] to (1)
set [Dir v] to (0)
set [Xvel v] to (0)
set [Yvel v] to (0)
forever  
clear
go to x: (0) y: (0)
switch to costume ((LevelNumber)+(1))
stamp
switch to costume [Marble v]
if <(Dir)=(0)>  
go to x: ((PlayerX)*(30)) y: ((PlayerY)*(30))
else
if <(Dir)=(1)> 
go to x: ((PlayerY)*(30)) y: ((PlayerX)*(-30))
else
if <(Dir)=(2)> 
go to x: ((PlayerX)*(-30)) y: ((PlayerY)*(-30))
else
go to x: ((PlayerY)*(-30)) y: ((PlayerX)*(30))
stamp
if <key [right arrow v] pressed?> 
switch to costume ((LevelNumber)+(1))
go to x: (0) y: (0)
clear
set [Dir v] to (((Dir)+(1)) mod (4))
set [PlayerX v] to (round (PlayerX))
set [PlayerY v] to (round (PlayerY))
repeat (10)  
turn ccw (9) degrees
if <key [left arrow v] pressed?> 
switch to costume ((LevelNumber)+(1))
go to x: (0) y: (0)
clear
set [Dir v] to (((Dir)-(1)) mod (4))
set [PlayerX v] to (round (PlayerX))
set [PlayerY v] to (round (PlayerY))
repeat (10)  
turn ccw (-9) degrees
if <<(Dir)=(0)> and <(0)=(letter((((round (PlayerX))+(0))+(4))+((((round ((PlayerY)+(0.5)))+ (-1))-(3))*(-7))) of (item (LevelNumber) of [LevelData v]))>> 
change [PlayerY v] by (-0.1)
if <<(Dir)=(1)> and <(0)=(letter((((round ((PlayerX)-(0.5)))+(1))+(4))+((((round ((PlayerY)+(0.5)))+(0))-(3))*(-7))) of (item (LevelNumber) of [LevelData v]))>> 
change [PlayerX v] by (0.1)
if <<(Dir)=(2)> and <(0)=(letter((((round (PlayerX))+(0))+(4))+((((round ((PlayerY)-(0.5)))+(1)) -(3))*(-7))) of (item (LevelNumber) of [LevelData v]))>> 
change [PlayerY v] by (0.1)
if <<(Dir)=(3)> and <(0)=(letter((((round ((PlayerX)+0.5))+(-1))+(4))+((((round ((PlayerY)-(0.5)))+(0))-(3))*(-7))) of (item (LevelNumber) of [LevelData v]))>> 
change [PlayerX v] by (-0.1)
end

Fixed.

Last edited by mitchboy (2012-02-23 17:01:18)


Quote of the week: "I am NOT being DRAMATIC!" ~Looney Tunes
Check out my newest game here!

Offline

 

#21 2012-02-23 16:58:39

CheeseMunchy
Scratcher
Registered: 2008-10-13
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

when i receive [lunch Time!]
Set [Size of pickle v] to [100]
Open [oven v]
Grab [pickle v]
pull up [chair v]
wait [3] secs
repeat until <(Size of pickle) = [0]>
[Chew v] for [3] secs
Change [Size of pickle v] by [-1]
wait [1] secs
say [ew this is nasty] for [2] secs

Last edited by CheeseMunchy (2012-02-23 17:00:32)


6418,

Offline

 

#22 2012-02-24 05:43:50

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

LS97 wrote:

Ooohhh, these posts gave me an idea... project summary to scratchblocks parser!!  big_smile

Taht's why this used to be in Advanced Topics—that was my goal.  smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#23 2012-02-24 06:46:03

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

Hardmath123 wrote:

LS97 wrote:

Ooohhh, these posts gave me an idea... project summary to scratchblocks parser!!  big_smile

Taht's why this used to be in Advanced Topics—that was my goal.  smile

And what stopped you from achieving it?  sad

Offline

 

#24 2012-02-24 14:17:00

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Official [Scratchblocks] Testing Play Area

Let me test... I might find a bug.

Test 1 No bugs in main subject. +0

[b]
when gf clicked
say [lol] for [u] secs
[/b][/u]
when gf clicked
say [b] for [i] secs
[/b][/i]

Test 2 Bugs detected: 1 (-1)
// testing
say [huh]
Test 3 No bugs! Achievement! No BBcode mess! (+2)
say [hehe] // [b] test [/b]
Test 4 No bugs! +1

say [MESS!!!!]

say [[b]] for [[haha]] secs
[/b]

Test 4.1 Funny, a bug did appear but it probably stopped a different bug! +0

go to [test v]
set x to (var)
set x to [haha]
[/b]


Test 5 Caught you! -1
when gf clicked
say 
for (haha) secs


Test 4.2 You win! +1

go to [test twice v]
set x to (variable)
set x to [haha twice]

forever
say (length of [bugs v]) for (2) secs // which is 2...
set [Current Rating v] to (((10) - (length of [bugs v])) + (length of [achievements v]))
say (Current Rating) // which is 12 out of 10

Last edited by rdococ (2012-02-24 15:09:35)

Offline

 

#25 2012-02-24 14:44:58

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: Official [Scratchblocks] Testing Play Area

CheeseMunchy wrote:

when i receive [lunch Time! v]
Set [Size of pickle v] to [100]
Open [oven v]
Grab [pickle v]
pull up [chair v]
wait [3] secs
repeat until <(Size of pickle) = [0]>
[Chew v] for [3] secs
Change [Size of pickle v] by [-1]
wait [1] secs
say [ew this is nasty] for [2] secs
end
broadcast [lunch eaten v]

when i receive [lunch eaten v]
say [LOLOLOLOLOLOLOL] for [a lot] secs

Offline

 

Board footer