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

#1 2012-09-04 11:35:31

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

New goodies I developed (including blocks2squeak and bingo 2.0)

It's nice to be back "connected" after such a long break from the internet. However I haven't lost time twiddling my thumbs, and have been developing quite a few things in the meantime.

I dusted out that old book in the back of my head called "Squeak", and managed to make a great plugin for Scratch that will effectively convert your blocks to Squeak!

You can download it from my dropbox here.
To use, right click on a block.

Furthermore, I have continued and almost completed the development of Bingo 2.0! Here are some of the features I am really proud of:
- Improved blocks and fixed glitches
- Implemented object oriented programming and data types
- Updated interface translations and help dialogs
- Added a working theme manager along with a home made default skin overhaul
- Allowed browsing of Mod Share 3 from within the Bingo program
- Improved tooltips and scroll bars
- Added a one-click EXE compiler (made in VB.NET) that actually works, with options for how you want the EXE to look like!
- Implemented automatic uploading to Mod Share 3!

I didn't have internet when I coded Bingo though, so the uploading part still needs to be programmed server side. Expect a release within the month!

--
For those interested I have also developed a series of programs not related to Scratch which will be coming up soon on my site, Futuresight Tech.

Offline

 

#2 2012-09-04 21:07:16

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Yay, you got the block-to-squeak working!  big_smile  I'll download it this afternoon.


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

Offline

 

#3 2012-09-05 11:28:31

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Hardmath123 wrote:

Yay, you got the block-to-squeak working!  big_smile  I'll download it this afternoon.

Yeah, the wonders boredom can do...  big_smile  Tell me how you think it is!

Offline

 

#4 2012-09-07 16:21:56

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

And bumpity...

Offline

 

#5 2012-09-07 21:38:43

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Sorry, LS97, I got a new Mac recently and I don't have Scratch on it. I'll test it on my old one as soon as I can.  smile


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

Offline

 

#6 2012-09-10 20:39:09

danwoodski
Scratcher
Registered: 2009-12-23
Posts: 100+

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

If you convert a script to squeak, does it run faster?


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://dl.dropbox.com/u/12506914/Pics/p2e-2.png&link2=http://dl.dropbox.com/u/12506914/Pics/ms.png&link3=http://dl.dropbox.com/u/12506914/Pics/block%20lib.png
Starting to move on to other languages, but I'll still be around from time to time  smile

Offline

 

#7 2012-09-11 09:18:20

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

I finally got it working on my old Mac, and it's totally awesome.  smile

when gf clicked
set [rotation-x v] to [0]
set [rotation-y v] to [0]
forever  
clear
set [repetition-n v] to [-3]
pen up
repeat ((length of [Coordinates v] ) / (3))  
change [repetition-n v] by (3)
if <[penup] = (item ((repetition-n) + (1)) of [Coordinates v] )>
pen up
else
set [xcoord v] to ((0.01) + (item ((repetition-n) + (1)) of [Coordinates v] ))
set [ycoord v] to ((0.01) + (item ((repetition-n) + (2)) of [Coordinates v] ))
set [zcoord v] to ((0.01) + (item ((repetition-n) + (3)) of [Coordinates v] ))
set [dist v] to ( [sqrt v] of (((xcoord) * (xcoord)) + ((zcoord) * (zcoord))))
set [angleFormed v] to (( [atan v] of ((xcoord) / (zcoord))) + (rotation-y))
if <(zcoord) < [0]> 
if <(xcoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-x v] to ((dist) * ( [sin v] of (angleFormed)))
set [new-z v] to ((dist) * ( [cos v] of (angleFormed)))
set [dist v] to ( [sqrt v] of (((ycoord) * (ycoord)) + ((new-z) * (new-z))))
set [angleFormed v] to (( [atan v] of ((ycoord) / (new-z))) + (rotation-x))
if <(new-z) < [0]> 
if <(ycoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-y v] to ((dist) * ( [sin v] of (angleFormed)))
set pen shade to (new-z)
go to x: (new-x) y: (new-y)
pen down
end
end
wait (0.1) secs
if <key [left arrow v] pressed?> 
change [rotation-y v] by (-10)
end
if <key [right arrow v] pressed?> 
change [rotation-y v] by (10)
end
if <key [up arrow v] pressed?> 
change [rotation-x v] by (10)
end
if <key [down arrow v] pressed?> 
change [rotation-x v] by (-10)
end
end

Code:

whenGreenflagClicked
    self setVar: 'rotation-x' to: '0'.
    self setVar: 'rotation-y' to: '0'.
    "forever was ignored: Squeak does not support them."
        self clearPenTrails.
        self setVar: 'repetition-n' to: '-3'.
        self putPenUp.
        self / timesRepeat: [
            self changeVar: 'repetition-n' by: 3.
            self = ifTrue: [
                self putPenUp.
            ] ifFalse: [
                self setVar: 'xcoord' to: self +.
                self setVar: 'ycoord' to: self +.
                self setVar: 'zcoord' to: self +.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-x' to: self *.
                self setVar: 'new-z' to: self *.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-y' to: self *.
                self setPenShadeTo: (self getVar: 'new-z').
                self gotoX: (self getVar: 'new-x') y: (self getVar: 'new-y').
                self putPenDown.
            ].
        ].
        "wait block ignored; not allowed in Squeak".
        (self keyPressed: 'left arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: -10.
        ].
        (self keyPressed: 'right arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: 10.
        ].
        (self keyPressed: 'up arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: 10.
        ].
        (self keyPressed: 'down arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: -10.
        ].
    "/end forever"

EDIT: +/-/x/div operators' operands are all messed up...  hmm

Last edited by Hardmath123 (2012-09-11 09:20:14)


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

Offline

 

#8 2012-09-11 09:30:06

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Hardmath123 wrote:

I finally got it working on my old Mac, and it's totally awesome.  smile

when gf clicked
set [rotation-x v] to [0]
set [rotation-y v] to [0]
forever  
clear
set [repetition-n v] to [-3]
pen up
repeat ((length of [Coordinates v] ) / (3))  
change [repetition-n v] by (3)
if <[penup] = (item ((repetition-n) + (1)) of [Coordinates v] )>
pen up
else
set [xcoord v] to ((0.01) + (item ((repetition-n) + (1)) of [Coordinates v] ))
set [ycoord v] to ((0.01) + (item ((repetition-n) + (2)) of [Coordinates v] ))
set [zcoord v] to ((0.01) + (item ((repetition-n) + (3)) of [Coordinates v] ))
set [dist v] to ( [sqrt v] of (((xcoord) * (xcoord)) + ((zcoord) * (zcoord))))
set [angleFormed v] to (( [atan v] of ((xcoord) / (zcoord))) + (rotation-y))
if <(zcoord) < [0]> 
if <(xcoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-x v] to ((dist) * ( [sin v] of (angleFormed)))
set [new-z v] to ((dist) * ( [cos v] of (angleFormed)))
set [dist v] to ( [sqrt v] of (((ycoord) * (ycoord)) + ((new-z) * (new-z))))
set [angleFormed v] to (( [atan v] of ((ycoord) / (new-z))) + (rotation-x))
if <(new-z) < [0]> 
if <(ycoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-y v] to ((dist) * ( [sin v] of (angleFormed)))
set pen shade to (new-z)
go to x: (new-x) y: (new-y)
pen down
end
end
wait (0.1) secs
if <key [left arrow v] pressed?> 
change [rotation-y v] by (-10)
end
if <key [right arrow v] pressed?> 
change [rotation-y v] by (10)
end
if <key [up arrow v] pressed?> 
change [rotation-x v] by (10)
end
if <key [down arrow v] pressed?> 
change [rotation-x v] by (-10)
end
end

Code:

whenGreenflagClicked
    self setVar: 'rotation-x' to: '0'.
    self setVar: 'rotation-y' to: '0'.
    "forever was ignored: Squeak does not support them."
        self clearPenTrails.
        self setVar: 'repetition-n' to: '-3'.
        self putPenUp.
        self / timesRepeat: [
            self changeVar: 'repetition-n' by: 3.
            self = ifTrue: [
                self putPenUp.
            ] ifFalse: [
                self setVar: 'xcoord' to: self +.
                self setVar: 'ycoord' to: self +.
                self setVar: 'zcoord' to: self +.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-x' to: self *.
                self setVar: 'new-z' to: self *.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-y' to: self *.
                self setPenShadeTo: (self getVar: 'new-z').
                self gotoX: (self getVar: 'new-x') y: (self getVar: 'new-y').
                self putPenDown.
            ].
        ].
        "wait block ignored; not allowed in Squeak".
        (self keyPressed: 'left arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: -10.
        ].
        (self keyPressed: 'right arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: 10.
        ].
        (self keyPressed: 'up arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: 10.
        ].
        (self keyPressed: 'down arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: -10.
        ].
    "/end forever"

EDIT: +/-/x/div operators' operands are all messed up...  hmm

How so?


Posts: 20000 - Show all posts

Offline

 

#9 2012-09-11 09:32:30

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

veggieman001 wrote:

Hardmath123 wrote:

I finally got it working on my old Mac, and it's totally awesome.  smile

when gf clicked
set [rotation-x v] to [0]
set [rotation-y v] to [0]
forever  
clear
set [repetition-n v] to [-3]
pen up
repeat ((length of [Coordinates v] ) / (3))  
change [repetition-n v] by (3)
if <[penup] = (item ((repetition-n) + (1)) of [Coordinates v] )>
pen up
else
set [xcoord v] to ((0.01) + (item ((repetition-n) + (1)) of [Coordinates v] ))
set [ycoord v] to ((0.01) + (item ((repetition-n) + (2)) of [Coordinates v] ))
set [zcoord v] to ((0.01) + (item ((repetition-n) + (3)) of [Coordinates v] ))
set [dist v] to ( [sqrt v] of (((xcoord) * (xcoord)) + ((zcoord) * (zcoord))))
set [angleFormed v] to (( [atan v] of ((xcoord) / (zcoord))) + (rotation-y))
if <(zcoord) < [0]> 
if <(xcoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-x v] to ((dist) * ( [sin v] of (angleFormed)))
set [new-z v] to ((dist) * ( [cos v] of (angleFormed)))
set [dist v] to ( [sqrt v] of (((ycoord) * (ycoord)) + ((new-z) * (new-z))))
set [angleFormed v] to (( [atan v] of ((ycoord) / (new-z))) + (rotation-x))
if <(new-z) < [0]> 
if <(ycoord) < [0]>
set [angleFormed v] to ((-180) + (angleFormed))
else
set [angleFormed v] to ((180) + (angleFormed))
end
end
set [new-y v] to ((dist) * ( [sin v] of (angleFormed)))
set pen shade to (new-z)
go to x: (new-x) y: (new-y)
pen down
end
end
wait (0.1) secs
if <key [left arrow v] pressed?> 
change [rotation-y v] by (-10)
end
if <key [right arrow v] pressed?> 
change [rotation-y v] by (10)
end
if <key [up arrow v] pressed?> 
change [rotation-x v] by (10)
end
if <key [down arrow v] pressed?> 
change [rotation-x v] by (-10)
end
end

Code:

whenGreenflagClicked
    self setVar: 'rotation-x' to: '0'.
    self setVar: 'rotation-y' to: '0'.
    "forever was ignored: Squeak does not support them."
        self clearPenTrails.
        self setVar: 'repetition-n' to: '-3'.
        self putPenUp.
        self / timesRepeat: [
            self changeVar: 'repetition-n' by: 3.
            self = ifTrue: [
                self putPenUp.
            ] ifFalse: [
                self setVar: 'xcoord' to: self +.
                self setVar: 'ycoord' to: self +.
                self setVar: 'zcoord' to: self +.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-x' to: self *.
                self setVar: 'new-z' to: self *.
                self setVar: 'dist' to: (self computeFunction: 'sqrt' of: self + ).
                self setVar: 'angleFormed' to: self +.
                self < ifTrue: [
                    self < ifTrue: [
                        self setVar: 'angleFormed' to: self +.
                    ] ifFalse: [
                        self setVar: 'angleFormed' to: self +.
                    ].
                ].
                self setVar: 'new-y' to: self *.
                self setPenShadeTo: (self getVar: 'new-z').
                self gotoX: (self getVar: 'new-x') y: (self getVar: 'new-y').
                self putPenDown.
            ].
        ].
        "wait block ignored; not allowed in Squeak".
        (self keyPressed: 'left arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: -10.
        ].
        (self keyPressed: 'right arrow' ) ifTrue: [
            self changeVar: 'rotation-y' by: 10.
        ].
        (self keyPressed: 'up arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: 10.
        ].
        (self keyPressed: 'down arrow' ) ifTrue: [
            self changeVar: 'rotation-x' by: -10.
        ].
    "/end forever"

EDIT: +/-/x/div operators' operands are all messed up...  hmm

How so?

Code:

                self setVar: 'xcoord' to: self +.
                self setVar: 'ycoord' to: self +.
                self setVar: 'zcoord' to: self +.

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

Offline

 

#10 2012-09-11 12:25:27

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Ah, I missed that! Thank you for spotting it, I will update it as soon as possible  smile

Offline

 

#11 2012-09-12 21:18:21

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Could you please put the B2Squeak as a standalone .CS? Pleasssssssssssssse?


Who would win, SOPA or PIPA?

Offline

 

#12 2012-09-13 11:54:27

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Just an idea - where you say forever isn't supported, can't you just do what the dialog box system does which is call "self world doOneCycle" every loop? (DialogBoxMorph getUserResponse)

E.g.

[true] whileTrue: ["code here" self world doOneCycle].


/* No comment */

Offline

 

#13 2012-09-13 14:48:37

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

TheSuccessor wrote:

Just an idea - where you say forever isn't supported, can't you just do what the dialog box system does which is call "self world doOneCycle" every loop? (DialogBoxMorph getUserResponse)

E.g.

[true] whileTrue: ["code here" self world doOneCycle].

I could, but then there would be absolutely no way to stop it, whereas in a scratch project you can just press the stop button.

Offline

 

#14 2012-09-13 14:53:24

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

MrFlash67 wrote:

Could you please put the B2Squeak as a standalone .CS? Pleasssssssssssssse?

I could, but why don't you just navigate to:
Scratch-Blocks > CommandBlockMorph > rightButtonMenu
and find the entry that says "convert to scratchblocks" or something.
Delete that entry and you'll revert all effects of the Block2Scratchblocks  smile

Offline

 

#15 2012-09-13 15:06:42

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

Awesome!

Code:

untitledMethod
    self setVar: 'bleh' to: '0'.
    (self keyPressed: 'left arrow' ) ifTrue: [
        self changeVar: 'xv' by: -0.7.
    ].
    (self keyPressed: 'right arrow' ) ifTrue: [
        self changeVar: 'xv' by: 0.7.
    ].
    self setVar: 'xv' to: self *.
    self changeXposBy: (self getVar: 'xv').
    (self touchingColor:  ) ifTrue: [
        self changeYposBy: 1.
        self changeVar: 'bleh' by: 1.
        (self touchingColor:  ) ifTrue: [
            self changeYposBy: 1.
            self changeVar: 'bleh' by: 1.
            (self touchingColor:  ) ifTrue: [
                self changeYposBy: 1.
                self changeVar: 'bleh' by: 1.
                (self touchingColor:  ) ifTrue: [
                    self changeYposBy: 1.
                    self changeVar: 'bleh' by: 1.
                    (self touchingColor:  ) ifTrue: [
                        self changeYposBy: 1.
                        self changeVar: 'bleh' by: 1.
                        (self touchingColor:  ) ifTrue: [
                            self changeXposBy: self *.
                            self setVar: 'xv' to: '0'.
                            self changeYposBy: -5.
                            (self keyPressed: 'up arrow' ) ifTrue: [
                                self changeXposBy: 5.
                                self setVar: 'c n' to: '-5'.
                                (self touchingColor:  ) ifTrue: [
                                    self setVar: 'xv' to: '-10'.
                                    self setVar: 'yv' to: '12'.
                                ] ifFalse: [
                                    self changeXposBy: -10.
                                    self setVar: 'c n' to: '5'.
                                    (self touchingColor:  ) ifTrue: [
                                        self setVar: 'xv' to: '10'.
                                        self setVar: 'yv' to: '12'.
                                    ].
                                ].
                                self changeXposBy: (self getVar: 'c n').
                            ] ifFalse: [
                                self changeVar: 'xv' by: self -.
                            ].
                        ] ifFalse: [
                        ].
                    ].
                ].
            ].
        ].
    ].
    self setVar: 'yv' to: self *.
    self changeYposBy: (self getVar: 'yv').
    (self touchingColor:  ) ifTrue: [
        self changeYposBy: self *.
        self setVar: 'yv' to: '0'.
    ].
    self changeYposBy: -1.
    (self keyPressed: 'up arrow' ) ifTrue: [
        (self touchingColor:  ) ifTrue: [
            self setVar: 'yv' to: '12'.
        ].
    ].
    self changeYposBy: 1.
    self < ifTrue: [
        self changeYposBy: -1.
        self not ifTrue: [
            self changeVar: 'yv' by: -1.
        ].
        self changeYposBy: 1.
    ].

........................................................................................................................................................................................................................................

Offline

 

#16 2012-09-13 15:21:40

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

LS97 wrote:

MrFlash67 wrote:

Could you please put the B2Squeak as a standalone .CS? Pleasssssssssssssse?

I could, but why don't you just navigate to:
Scratch-Blocks > CommandBlockMorph > rightButtonMenu
and find the entry that says "convert to scratchblocks" or something.
Delete that entry and you'll revert all effects of the Block2Scratchblocks  smile

What I meant, is that the blocks2scratchblocks was a .cs (I think), and I could easily file it in, and I want a .cs file just for the blocks2squeak. Does the blocks2squeak change the right-click menu?


Who would win, SOPA or PIPA?

Offline

 

#17 2012-09-14 14:01:07

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

Re: New goodies I developed (including blocks2squeak and bingo 2.0)

MrFlash67 wrote:

LS97 wrote:

MrFlash67 wrote:

Could you please put the B2Squeak as a standalone .CS? Pleasssssssssssssse?

I could, but why don't you just navigate to:
Scratch-Blocks > CommandBlockMorph > rightButtonMenu
and find the entry that says "convert to scratchblocks" or something.
Delete that entry and you'll revert all effects of the Block2Scratchblocks  smile

What I meant, is that the blocks2scratchblocks was a .cs (I think), and I could easily file it in, and I want a .cs file just for the blocks2squeak. Does the blocks2squeak change the right-click menu?

Of course!
However, the blocks3squeak will override any previously installed right menu buttons. That is why I have released both together.

Offline

 

Board footer