Discuss Scratch

MrWhiskers
Scratcher
3 posts

.sb2 (scratch files) to JAR

I'm working as a high school student for a professor as part of summer program. he chose me because he felt I was qualified to create an ecological module for him. However, the only language I know is Scratch. He asked if there is a way to convert scratch to java such that he can go in there and see what I made and edit it, as java gives you more to work with. I know there is a way to do it, but I'm not sure how, and all of the old ones I have looked at online no longer work.

Any suggestions?

Instructions greatly appreciated

Thanks,
MrWhiskers
djdolphin
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

You can convert Scratch 1.4 projects (.sb files) to .jar files using Scratch to Desktop Applikation, but there is currently no way to convert Scratch 2.0 projects (.sb2 files) to a java application. It's pretty straightforward, but you can find instructions here.

Last edited by djdolphin (June 18, 2013 20:03:40)


!
MrWhiskers
Scratcher
3 posts

.sb2 (scratch files) to JAR

I already looked at the link provided, and the link to Mediafire doesn't work. it is a faulty download that does not exist.
Hardmath123
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

I don't think this will actually transcribe the code for you, it will just generate a package with a Java-based player and the project bundled together. But I may be wrong.
Hardmath123
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

I have a suggestion for you: you can convert most Scratch 2.0 projects to a new JavaScript-based format that is executed by a program called “Snap!” developed by a team at Berkeley (I wrote a nice little program in Python (another programming language) to hack it together).

Snap! is almost a direct port of Scratch, it just adds many, many new features like custom reporter blocks and “lambda”. I'm sure you'll understand it instantly. Your professor would find Snap! very interesting, and Snap! is powerful enough to communicate with modules written in other languages. You can, without too much trouble, read and write files to your computer, control the Lego Mindstorms NXT brick, and much more without having to learn a new language.

The current version is hosted here, in case you want to try it out: http://snap.berkeley.edu/run . Good luck!
jji7skyline
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

Here's a working link to the Scratch to Desktop Applikation, better known as ToJar.

https://www.dropbox.com/s/tbef6oqlpe1qgx7/ToJAR.zip

It only works with 1.4 scratch files btw.
cool_dude_2
Scratcher
100+ posts

.sb2 (scratch files) to JAR

maybe you could work with the raw project.JSON file in the *.sb2 file

Browser:, Flash 21.0 (release 0) with Either Firefox or Vivaldi.
I'm on a helping RAMPAGE! I go find questions that I can answer helpfully and help whoever with whatever on Scratch and elsewhere on the network of interconnected networks!
when green flag clicked
forever
help with question (currentQuestionIndex)
next [question v]
end
I MAY or MAY NOT be the REAL Jonathan Fakename.
comp500
Scratcher
100+ posts

.sb2 (scratch files) to JAR

cool_dude_2 wrote:

maybe you could work with the raw project.JSON file in the *.sb2 file
practically impossible - it would be really hard and would not help change it into java

Hardmath123 wrote:

I don't think this will actually transcribe the code for you, it will just generate a package with a Java-based player and the project bundled together. But I may be wrong.
i think you're right

MrWhiskers wrote:

I'm working as a high school student for a professor as part of summer program. he chose me because he felt I was qualified to create an ecological module for him. However, the only language I know is Scratch. He asked if there is a way to convert scratch to java such that he can go in there and see what I made and edit it, as java gives you more to work with. I know there is a way to do it, but I'm not sure how, and all of the old ones I have looked at online no longer work.

Any suggestions?

Instructions greatly appreciated

Thanks,
MrWhiskers
you would have to transcribe the code yourself - or get someone to do it for you


Ubuntu 13.04: Chrome 29.0.1547.76, Flash 11.8 (release 800) Windows 7: Same Both: Dell Inspiron 545: Dual-Core w/3GB RAM… let's stop boasting now…
For more info ask me on my profile page…
AttackScratch.php
drmcw
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

Why not prototype it in Scratch then bite the bullet and learn some java?

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
bobbysq
Scratcher
100+ posts

.sb2 (scratch files) to JAR

Why not just play it on the website?
comp500
Scratcher
100+ posts

.sb2 (scratch files) to JAR

bobbysq wrote:

Why not just play it on the website?
he wants it in java… transcribed


Ubuntu 13.04: Chrome 29.0.1547.76, Flash 11.8 (release 800) Windows 7: Same Both: Dell Inspiron 545: Dual-Core w/3GB RAM… let's stop boasting now…
For more info ask me on my profile page…
AttackScratch.php
Walrus227
Scratcher
54 posts

.sb2 (scratch files) to JAR

Hardmath123 wrote:

I have a suggestion for you: you can convert most Scratch 2.0 projects to a new JavaScript-based format that is executed by a program called “Snap!” developed by a team at Berkeley (I wrote a nice little program in Python (another programming language) to hack it together).

Snap! is almost a direct port of Scratch, it just adds many, many new features like custom reporter blocks and “lambda”. I'm sure you'll understand it instantly. Your professor would find Snap! very interesting, and Snap! is powerful enough to communicate with modules written in other languages. You can, without too much trouble, read and write files to your computer, control the Lego Mindstorms NXT brick, and much more without having to learn a new language.

The current version is hosted here, in case you want to try it out: http://snap.berkeley.edu/run . Good luck!
FYI Snap! is the newest version of BYOB.
8discobusy
Scratcher
98 posts

.sb2 (scratch files) to JAR

Converting .sb2 to JavaScript is easy just do it here but converting .sb2 to jar is harder.

Dmith
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

sb2 to jar? do someone know about?
TheMy5teryMan
New to Scratch
5 posts

.sb2 (scratch files) to JAR

What about Javascript to sb2?
goldfish678
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

blob8108 made a .sb2 to .sb converter that you could use, and there's also a .sb to .jar converter somewhere. Unfortunately the many features of 2.0 (cloud variables, custom blocks, vector, clones, etc.) will be removed if you have any in your project.
MegaApuTurkUltra
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

Yeah I don't think it's possible to transcribe Scratch 2 to Java automatically. I think you'll just need to learn java, as drmcw said, and maybe prototype in Scratch.

If you want to learn java, the oracle java tutorials are a great place to start: http://docs.oracle.com/javase/tutorial/
Then, if you're looking for things like fast graphics, you may want to use an external library instead of the default Java windowing system (which isn't meant for high fps apps).

Also, you'll probably want a good IDE for Java, instead of writing code in a normal text editor. Try Eclipse, IntelliJ IDEA, or NetBeans. They provide some good features like automatic error highlighting, awesome debugging, and project dependency management.

Last edited by MegaApuTurkUltra (Oct. 4, 2014 13:37:28)


$(".box-head")[0].textContent = "committing AT crimes since $whenever"
Dmith
Scratcher
1000+ posts

.sb2 (scratch files) to JAR

DeutschBlitz
Scratcher
30 posts

.sb2 (scratch files) to JAR

I'm probably a bit late, but you can use BYOB (a modification of Scratch, still using Scratch scripts just with a few extras) to make and then convert Scratch 1.4 projects to .exe (supposing you're using an operating system that can use that file)

A-Geek
Scratcher
48 posts

.sb2 (scratch files) to JAR

MrWhiskers wrote:

I'm working as a high school student for a professor as part of summer program. he chose me because he felt I was qualified to create an ecological module for him. However, the only language I know is Scratch. He asked if there is a way to convert scratch to java such that he can go in there and see what I made and edit it, as java gives you more to work with. I know there is a way to do it, but I'm not sure how, and all of the old ones I have looked at online no longer work.

Any suggestions?

Instructions greatly appreciated

Thanks,
MrWhiskers

SB to JAR (Java executable)

Works on all operating systems with a Java runtime installed. (Mac, Windows, and Linux)

Download TOJar From GItHub
Unpack/extract the .zip file by right clicking and choosing extract all… on Windows and by double clicking on Mac
In the ToJAR folder, double click on the program folder, then on the dist folder and then double click on the ToJAR.jar file.
This will launch the ToJAR App. It Should Look Like This.



Click the first select button and choose your input (SB) file.
Choose your output name, and be sure to append the .jar file extension, for example Example.jar
Choose your output location, being sure to put the name of your JAR file at the end. For example, C: / Documents and Settings/Documents/Example.jar
Click compile


Examples

This is what a chatbot looks like, running as a bundled JAR.



Got A .Sb2 File? I've Got A Solution For that 2

Just Go To The Retro Converter

SB to APP via online player

Using the native Xcode development suite, a Scratch Project can be converted into an application by referencing the online player. To do this, one must open the project and get the Embed URL. Then the embed URL must be used to create an HTML page using the UIWebView Cocoa class.
Creating a project

First, create an Xcode project, and name it iScratchProj. Replace the contents of iScratchProjAppDelegate.h with:

// Import Cocoa framework
#import <Cocoa/Cocoa.h>
// Import WebKit framework
#import <WebKit/WebKit.h>

@interface iBlobAppDelegate : NSObject <NSApplicationDelegate> {
// Create the window
NSWindow *window;

// Get the applet
IBOutlet id webView;
}
// Get the window
@property (assign) IBOutlet NSWindow *window;

@end

Next, replace to contents of iScratchProjAppDelegate.m with:

#import “iBlobAppDelegate.h”

@implementation iBlobAppDelegate

@synthesize window;

// When the application loaded…
- (void)applicationDidFinishLaunching: (NSNotification *)aNotification {
// Add the applet to the screen
;
}

@end

Click on the yellow bubbles, and fill in your username and the ID of your project (the number at the end of its URL, e.g. http://scratch.mit.edu/projects/Hardmath123/2433673).


Hope This Helps!

A-Geek


Last edited by A-Geek (Dec. 30, 2014 17:58:41)



I'm Using Flash 11.2 (release 202)

Powered by DjangoBB