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

#1 2012-02-23 10:58:03

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

Testing the blocks plugin

    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")
                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" 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
EDIT: That's pretty good, some stuff is a bit off...

I did this by shift-clicking the File menu and clicking "Write project summary...". The .txt file on my desktop contained the above code.  big_smile

Last edited by Hardmath123 (2012-02-23 11:00:50)


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

Offline

 

#2 2012-02-23 11:00:17

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: Testing the blocks plugin


Posts: 20000 - Show all posts

Offline

 

#3 2012-02-23 11:01:57

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

Re: Testing the blocks plugin

Ah, I was hoping to see something like that, but obviously our search feature could be further optimized.

Reporting for closing...


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

Offline

 

#4 2012-02-23 11:09:29

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Testing the blocks plugin

i've already got something like this in java i can post the source if you want


http://i.imgur.com/1QqnHxQ.png

Offline

 

#5 2012-02-23 11:15:40

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

Re: Testing the blocks plugin

But... I reported this for closing...  tongue

EDIT: Post it in Veggieman's link.

Last edited by Hardmath123 (2012-02-23 11:16:02)


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

Offline

 

#6 2012-02-23 12:08:04

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

Re: Testing the blocks plugin

Closed by request


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

Offline

 

Board footer