Discuss Scratch

kittycat841
Scratcher
100+ posts

Scratch to Javascript converter

Oh, hello!
I'm here to discuss a new feature that should be added to Scratch: A Scratch to Javascript converter!
Now, you may be thinking, how would this be useful?
I'll tell you why.
There are other applications out there, and most of them use JavaScript. JavaScript can be hard to learn, so why not make a converter? Then, Scratchers can take their project and put it into another application. This would make things a lot easier for scratchers.

Well?
I'm not keeping track of Supporters this time, so PLEASE give reasons why it should or shouldn't be added into Scratch.
Thanks for reading this.

not on scratch anymore sorry
Sheep_maker
Scratcher
1000+ posts

Scratch to Javascript converter

You can't convert a costume into Javascript, I believe.

Would this be like a “download to computer as .js” button?

- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
Sigton
Scratcher
1000+ posts

Scratch to Javascript converter

The problem is Scratch doesn't function the same way as any other languages, and is often extremely difficult to represent Scratch code as text. For example, what would a sprite be in javascript? The backdrop, costumes, sounds and so on and so forth.

Sigton


-stache-
Scratcher
500+ posts

Scratch to Javascript converter

Sheep_maker wrote:

You can't convert a costume into Javascript, I believe.

Would this be like a “download to computer as .js” button?
You can store it as a data: urI though


3x3 pb: 13.240
3x3 avg: ~21-26
jokebookservice1
Scratcher
1000+ posts

Scratch to Javascript converter

I disagree that most applications use JavaScript, that is mostly used on the we. For applications, Java is more common I elieve (though you can make JS apps via Electron).

Scratch code is representable as JSON, and so can be interpreted by JavaScript (Phosphorus).

So if it would just output phosphorus with the input being some JSON that could work, or perhaps instead of Phosphorus running the code for a project, it would output that code. e.g.

/*
Code to set-up canvas goes here
*/
Scratch.sprite.xPosition += 10;
Scratch.refreshScreen(); //etc.
That could work

Last edited by jokebookservice1 (Sept. 17, 2016 19:06:46)

Falcon1234567
Scratcher
20 posts

Scratch to Javascript converter

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
The4thPixel
Scratcher
1000+ posts

Scratch to Javascript converter

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
The Original Post is suggesting the exact opposite, a way to convert Scratch Blocks into JavaScript.
Sigton
Scratcher
1000+ posts

Scratch to Javascript converter

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
JavaScript has a lot of features that Scratch doesn't, so this wouldn't really be possible.

Sigton


ateesdalejr
Scratcher
100+ posts

Scratch to Javascript converter

Sigton wrote:

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
JavaScript has a lot of features that Scratch doesn't, so this wouldn't really be possible.

Sigton
The logic of this sentence makes me cry.
I believe this has been already done with phosphorus. It just runs the js. I'm sure if you asked someone nicely they could mess with it enough to produce a compiled output.

jesseli2007
Scratcher
15 posts

Scratch to Javascript converter

I'm trying to convert this block:
if <> then

end
jokebookservice1
Scratcher
1000+ posts

Scratch to Javascript converter

jesseli2007 wrote:

I'm trying to convert this block:
if <> then

end
This isn't really the place to ask, but in JavaScript you would do
if(){
 
}

You can drop the {} if there is only one statement.

Last edited by jokebookservice1 (Dec. 28, 2016 18:40:13)

MegaApuTurkUltra
Scratcher
1000+ posts

Scratch to Javascript converter

Phosphorus is technically a Scratch to javascript converter

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

Scratch to Javascript converter

Support, if it's possible. I'd like to be able to download my games and upload them to gamejolt or something without having to worry about people remixing or cheating.
I'd also support a scratch to exe converter if it's possible.
Sigton
Scratcher
1000+ posts

Scratch to Javascript converter

ateesdalejr wrote:

The logic of this sentence makes me cry.
I believe this has been already done with phosphorus. It just runs the js. I'm sure if you asked someone nicely they could mess with it enough to produce a compiled output.
They were asking about the other way round.

Sigton


jokebookservice1
Scratcher
1000+ posts

Scratch to Javascript converter

A Scratch to Javascript converter!
phosphorus
They were asking about the other way round.
I don't think they were.
Sigton
Scratcher
1000+ posts

Scratch to Javascript converter

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.

jokebookservice1 wrote:

I don't think they were.
I beg to differ

Sigton


jokebookservice1
Scratcher
1000+ posts

Scratch to Javascript converter

Sigton wrote:

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.

jokebookservice1 wrote:

I don't think they were.
I beg to differ

Sigton
You quoted the wrong person in your post then
Sigton
Scratcher
1000+ posts

Scratch to Javascript converter

ateesdalejr wrote:

Sigton wrote:

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
JavaScript has a lot of features that Scratch doesn't, so this wouldn't really be possible.

Sigton
The logic of this sentence makes me cry.
I believe this has been already done with phosphorus. It just runs the js. I'm sure if you asked someone nicely they could mess with it enough to produce a compiled output.

jokebookservice1 wrote:

You quoted the wrong person in your post then
…no I didn't…

Sigton


jokebookservice1
Scratcher
1000+ posts

Scratch to Javascript converter

Sigton wrote:

ateesdalejr wrote:

Sigton wrote:

Falcon1234567 wrote:

Can u make javascript into scratchblocks using this?

Cos most games are in javascript and you can ‘watch and learn’ the code and how to recreate in scratch.
JavaScript has a lot of features that Scratch doesn't, so this wouldn't really be possible.

Sigton
The logic of this sentence makes me cry.
I believe this has been already done with phosphorus. It just runs the js. I'm sure if you asked someone nicely they could mess with it enough to produce a compiled output.

jokebookservice1 wrote:

You quoted the wrong person in your post then
…no I didn't…

Sigton
There us too much ambiguity. I feel like your post was quoted by ateesdalejr simply to mention that the logic of the post made little sense. I feel like the rest of the post was in reference to the OP.

We will never know, however.
nickeljorn
Scratcher
1000+ posts

Scratch to Javascript converter

Support! I was thinking of suggesting a “view code” option (Like on Code.Org) with several programming languages to choose from, such as JavaScript, Python, Ruby, etc.

"Just what is the Summer Solstice, besides the day I melt into a puddle of fuzzy puppy fluff?”-Isabelle, Animal Crossing New Leaf

Powered by DjangoBB