Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Scratch 3.0 Technical Discussion
- MrMeowington
-
100+ posts
Scratch 3.0 Technical Discussion
Yes, let's.-MASSIVE SNIP-Okay, let's get back on topic.
I did the math, and there are only ~3 weeks left before Scratch 3.0 comes out (unless something's changed).
There's not much development time left before it's released officially.
- Ed8
-
100+ posts
Scratch 3.0 Technical Discussion
Yes, let's.-MASSIVE SNIP-Okay, let's get back on topic.
I did the math, and there are only ~3 weeks left before Scratch 3.0 comes out (unless something's changed).
There's not much development time left before it's released officially.

- DoatRedding
-
5 posts
Scratch 3.0 Technical Discussion
So, I know Scratch 3.0 works for Lego Mindstorms EV3, But does it also work for Mindstorms' older version, the NXT?
- ericr
-
24 posts
Scratch 3.0 Technical Discussion
So, I know Scratch 3.0 works for Lego Mindstorms EV3, But does it also work for Mindstorms' older version, the NXT?
We do not have plans to support the LEGO NXT kit in Scratch 3.0, sorry!
- MabonBaladevaKain
-
100+ posts
Scratch 3.0 Technical Discussion
Will we be able to save our Scratch project files as .apk files and sign them easily to make apps for Google Play and/or other app stores?
Please say yes. It is the only feature that really needs to be added. The rest are not important.
If not then I will have to spend most of my time on something other than Scratch or find some way to turn Scratch projects into .apk
and I have no clue how to do that at all. Most likely I will end up having to learn an entirely different interface and/or text syntax of
some other game creation tool and/or coding language that I don't have time to spend upon. Everything that I have found so far that
codes directly to .apk has way more cumbersome of interfaces compared to Scratch or needs several large bloatware programs to
be installed before they are capable of converting code to .apk and that does not even guarantee that it will work correctly.
It needs to be a standalone native .apk because I tried turning Scratch projects into hybrid apps and that did not work out so well.
The game would not always work and it required the internet while playing the game and it took way too long loading if it did work.
And that was for a really simple little game that just moved a spotlight around the screen. So it has to be native android .apk.
- infinitytec
-
1000+ posts
Scratch 3.0 Technical Discussion
I sincerely doubt that the ST will be doing this. Will we be able to save our Scratch project files as .apk files and sign them easily to make apps for Google Play and/or other app stores?
Please say yes. It is the only feature that really needs to be added. The rest are not important.
If not then I will have to spend most of my time on something other than Scratch or find some way to turn Scratch projects into .apk
and I have no clue how to do that at all. Most likely I will end up having to learn an entirely different interface and/or text syntax of
some other game creation tool and/or coding language that I don't have time to spend upon. Everything that I have found so far that
codes directly to .apk has way more cumbersome of interfaces compared to Scratch or needs several large bloatware programs to
be installed before they are capable of converting code to .apk and that does not even guarantee that it will work correctly.
It needs to be a standalone native .apk because I tried turning Scratch projects into hybrid apps and that did not work out so well.
The game would not always work and it required the internet while playing the game and it took way too long loading if it did work.
And that was for a really simple little game that just moved a spotlight around the screen. So it has to be native android .apk.
- 0037318
-
100+ posts
Scratch 3.0 Technical Discussion
Will we be able to save our Scratch project files as .apk files and sign them easily to make apps for Google Play and/or other app stores?
Please say yes. It is the only feature that really needs to be added. The rest are not important.
If not then I will have to spend most of my time on something other than Scratch or find some way to turn Scratch projects into .apk
and I have no clue how to do that at all. Most likely I will end up having to learn an entirely different interface and/or text syntax of
some other game creation tool and/or coding language that I don't have time to spend upon. Everything that I have found so far that
codes directly to .apk has way more cumbersome of interfaces compared to Scratch or needs several large bloatware programs to
be installed before they are capable of converting code to .apk and that does not even guarantee that it will work correctly.
It needs to be a standalone native .apk because I tried turning Scratch projects into hybrid apps and that did not work out so well.
The game would not always work and it required the internet while playing the game and it took way too long loading if it did work.
And that was for a really simple little game that just moved a spotlight around the screen. So it has to be native android .apk.
Scratch is just now adding support of any kind for mobile devices. Why would they try and turn it into an entire app?
- MabonBaladevaKain
-
100+ posts
Scratch 3.0 Technical Discussion
Turning Scratch into an app is NOT what I am asking.
I simply want to know if I will be able to save my work in Scratch 3.0 (the code I create with it) as a standalone android file.
I'm certain that it can be done. I just don't know how to do it. Even full websites can be played offline without the internet,
so why would a project + the player to play it be any different? … Surely it is not that difficult of a thing to do for the people
at MIT who are in charge of having created Scratch.
Btw, If you just want to make things with Scratch on your mobile device, they already have that.
It's called Scratch Xbot and you can get it for free off the Google Play store, but I reiterate that this is NOT what I am asking.
I want to create a project on Scratch 3.0, save the project file along with just the player to play it (no editor) as a .apk file that can
be signed to allow for possible sale on app stores such as Google Play.
I want to use Scratch 3.0 as a launching platform to create apps until I learn how to code something like Java.
Even if it had a Java code option in Scratch 3.0 where it shows what the Scratch blocks would be in Java code would be useful,
because even though I would still need to download lots of things, at least I could have a starting point by copy/pasting the code
over into a normal programming interface like Android Studio and then perform whatever tweaks are needed there.
I have heard that it is notoriously slow to test programs for Android and Scratch would be a great prototyping tool if it had at least
one of these features. Surely you can see the benefit of having Scratch projects associated with a real coding language.
It would then be powerful enough to help those who want to program learn how to code in a real accredited programming language.
Oh, and I am also wondering, when Scratch 2.0 becomes Scratch 3.0, will the Instructions and the Notes and Credits for our games
be transferred over to Scratch 3.0 or do we need to copy them to a text file in order to keep them?
I simply want to know if I will be able to save my work in Scratch 3.0 (the code I create with it) as a standalone android file.
I'm certain that it can be done. I just don't know how to do it. Even full websites can be played offline without the internet,
so why would a project + the player to play it be any different? … Surely it is not that difficult of a thing to do for the people
at MIT who are in charge of having created Scratch.
Btw, If you just want to make things with Scratch on your mobile device, they already have that.
It's called Scratch Xbot and you can get it for free off the Google Play store, but I reiterate that this is NOT what I am asking.
I want to create a project on Scratch 3.0, save the project file along with just the player to play it (no editor) as a .apk file that can
be signed to allow for possible sale on app stores such as Google Play.
I want to use Scratch 3.0 as a launching platform to create apps until I learn how to code something like Java.
Even if it had a Java code option in Scratch 3.0 where it shows what the Scratch blocks would be in Java code would be useful,
because even though I would still need to download lots of things, at least I could have a starting point by copy/pasting the code
over into a normal programming interface like Android Studio and then perform whatever tweaks are needed there.
I have heard that it is notoriously slow to test programs for Android and Scratch would be a great prototyping tool if it had at least
one of these features. Surely you can see the benefit of having Scratch projects associated with a real coding language.
It would then be powerful enough to help those who want to program learn how to code in a real accredited programming language.
Oh, and I am also wondering, when Scratch 2.0 becomes Scratch 3.0, will the Instructions and the Notes and Credits for our games
be transferred over to Scratch 3.0 or do we need to copy them to a text file in order to keep them?
- 0037318
-
100+ posts
Scratch 3.0 Technical Discussion
Turning Scratch into an app is NOT what I am asking.
I simply want to know if I will be able to save my work in Scratch 3.0 (the code I create with it) as a standalone android file.
I'm certain that it can be done. I just don't know how to do it. Even full websites can be played offline without the internet,
so why would a project + the player to play it be any different? … Surely it is not that difficult of a thing to do for the people
at MIT who are in charge of having created Scratch.
Btw, If you just want to make things with Scratch on your mobile device, they already have that.
It's called Scratch Xbot and you can get it for free off the Google Play store, but I reiterate that this is NOT what I am asking.
I want to create a project on Scratch 3.0, save the project file along with just the player to play it (no editor) as a .apk file that can
be signed to allow for possible sale on app stores such as Google Play.
I want to use Scratch 3.0 as a launching platform to create apps until I learn how to code something like Java.
Even if it had a Java code option in Scratch 3.0 where it shows what the Scratch blocks would be in Java code would be useful,
because even though I would still need to download lots of things, at least I could have a starting point by copy/pasting the code
over into a normal programming interface like Android Studio and then perform whatever tweaks are needed there.
I have heard that it is notoriously slow to test programs for Android and Scratch would be a great prototyping tool if it had at least
one of these features. Surely you can see the benefit of having Scratch projects associated with a real coding language.
It would then be powerful enough to help those who want to program learn how to code in a real accredited programming language.
Websites are viewed offline using html files, which is a collection of html and javascript. The nature of scratch conflicts with the nature of java. In scratch, variables do not have types. You can set it to anything. If you try to do an operation on a string, a default number will be returned. In Java, all values would have to be stored as a string, and if you wanted to do an operation on something, it would create an unexpected result because you are doing operations on a string, and not an integer. If you stored all values as an integer, you would not be able to store strings into the variables. Many scratch projects rely on the ability to use strings AND numbers synonymously, and Java simply can't do that. If you want to use scratch to build an android app, I would recommend using app inventor at http://ai2.appinventor.mit.edu/ which allows you to code apps using blocks and then test them through their app.
- MabonBaladevaKain
-
100+ posts
Scratch 3.0 Technical Discussion
http://ai2.appinventor.mit.edu/ which allows you to code apps using blocks and then test them through their app.Websites are viewed offline using html files, which is a collection of html and javascript. The nature of scratch conflicts with the nature of java. In scratch, variables do not have types. You can set it to anything. If you try to do an operation on a string, a default number will be returned. In Java, all values would have to be stored as a string, and if you wanted to do an operation on something, it would create an unexpected result because you are doing operations on a string, and not an integer. If you stored all values as an integer, you would not be able to store strings into the variables. Many scratch projects rely on the ability to use strings AND numbers synonymously, and Java simply can't do that. If you want to use scratch to build an android app, I would recommend using app inventor at
I have been considering app inventor anyway, but am concerned about having to learn its interface. GDevelop looks easier to use, but I will need to download many programs and do extra steps to port the code to Android. I might be better off going straight into Java coding with Android Studio though to avoid the inevitable disappointment of something like not being able to build native android apps for example …
which leads me to the question: Can I build fully Native Android apps (meaning I do not need to have internet available to run the game) with app inventor?
Well does anyone know of a Scratch to Java converter that will take the .sb2 file and display it in Java? … Even if it left the variables as text equivalents of the block versions, at least then I could go back through and edit those to be of the Java syntax. Then I would have a Java version of the same program that I created in Scratch. I would still need to make speed adjustments according to how much faster it will likely run in Java compared to Scratch, but that is no big deal.
Scratch needs a way to teach actual programming anyway or else it really is just a toy after all. Right now there is no real correlation other than it being a form of logic to build something with, but so are Lego blocks and those too are just toys. Building a vehicle for real use out of Legos for example would not work out so well unless they are metal or fiberglass Legos that chemically weld themselves together when friction is applied, then a frame for a roadworthy vehicle could potentially be made I suppose. I guess what I am saying is I'm looking for those chemically self-welding Lego bricks that would be the Ultimate Scratch build so I can build something that is actually useful to people, make it available to a wider audience, and learn how to code some of a real programming language in the process. It sure would save a ton of time.
(I know self welding useful Lego bricks you can build a real car with probably sounds crazy, but it works well enough for a visual aid right?)
Why can't they have something as simple to use as Scratch but that can be easily converted to Android? If I knew how to do so, I would take the source of Scratch apart and piece in something myself to make it all work to convert project files (with the viewer if it needs it) into native .apk that can be signed and placed into app stores or at least have it show what the code would be if it had been coded in Java (like how they did in Stencyl with actionscript or Haxe script or whatever it was). But if I knew how to do that, I would not need such features in the first place because I would already be coding directly in Java most likely.
- MabonBaladevaKain
-
100+ posts
Scratch 3.0 Technical Discussion
Let's get back on topic OK?
Everything I have mentioned is relevant and related to Scratch 3.0 technical discussion. I have never left topic.
None of you have answered even a single question other than to antagonize and troll me.
Just because my wording happens to be a little long, that does not make it any less relevant.
Can you at least then please tell me, Once they move the Scratch 2.0 projects to Scratch 3.0, will all of
the projects' Descriptions / Notes and Credits be copied over too? Or do we have to save all that stuff ourselves
if we wish to keep them? ….
- imfh
-
1000+ posts
Scratch 3.0 Technical Discussion
I'm sure they'll keep them as it would be really hard for people to do manually, it should be really easy to do on the server since it's just text, and they would have said something if not.
- _nix
-
1000+ posts
Scratch 3.0 Technical Discussion
This isn't a feature the Scratch Team is working on, as far as I know (and I more or less keep track of pretty much all their open source repositories and public discussion). While maybe it's not out of scope of Scratch 3.0 as a programming tool, it makes sense that the Scratch Team seems not to have prioritized the idea at all – their target audience is people who are learning programming, not developing and publishing/selling apps. While there Will we be able to save our Scratch project files as .apk files and sign them easily to make apps for Google Play and/or other app stores?are people like you who want to be able to release projects as easily-distributed binaries (APKs, EXEs, you name it), that just isn't everyone.
Please say yes. It is the only feature that really needs to be added. The rest are not important.
I can't recall if the ST has said anything about SB3 -> EXE. They may have said they're considering it (but do not quote me on that), but I doubt it's something they'd be working on right now, seeing as there's so much else they had to finish before release and there hasn't been any mention of converting Scratch projects to EXEs inside 3.0 FAQ, official ST announcements, etc. (I'm saying -> exe instead of exe/apk because I just cannot remember APK files / android export having been mentioned anywhere before your posts here.)
I want to create a project on Scratch 3.0, save the project file along with just the player to play it (no editor) as a .apk file that canFor what it's relevant, this is more hypothetically possible with Scratch 3.0 than ever before – Scratch 3.0 is broken up into several components, and the editor (“gui” and “blocks”) doesn't need to be loaded to run the player (“vm”, “render”, etc). But of course, that's not to say the ST is working on such a tool.
be signed to allow for possible sale on app stores such as Google Play.
Even if it had a Java code option in Scratch 3.0 where it shows what the Scratch blocks would be in Java code would be useful […]Unfortunately that's not reasonably possible, because Scratch is and has always been an interpreted language, not a compiled one. There's no way to simply show a standalone text-version of your scripts because they require the Scratch “VM” (part of 3.0; in 2.0, just known as the Scratch interpreter) to function. (Scratch is interpreted rather than compiled so that it's practical to allow Scratch projects to be edited and experimented/played-with while they're running.)
Oh, and I am also wondering, when Scratch 2.0 becomes Scratch 3.0, will the Instructions and the Notes and Credits for our gamesThey will all transfer automatically – you don't need to worry about making any updates yourself. The only thing that will not automatically be transferred from 2.0 to 3.0 is the contents of your backpack (see this project).
be transferred over to Scratch 3.0 or do we need to copy them to a text file in order to keep them?
Well does anyone know of a Scratch to Java converter that will take the .sb2 file and display it in Java? … Even if it left the variables as text equivalents of the block versions, at least then I could go back through and edit those to be of the Java syntax.There's no official way to convert Scratch projects to code in any other programming language, but if you're experienced with JavaScript and poking around other people's source code, I believe the community-made phosphorus tool internally compiles Scratch projects to JavaScript. (Certainly not Java, but maybe worth looking at anyway. BTW, phosphorus is an alternate Scratch player that can run sb2 files on any HTML5-supporting browser; and it does a very impressive job at running sb2 projects exactly the way they run in the official Scratch 2.0 player.)
Scratch needs a way to teach actual programming anyway or else it really is just a toy after all. Right now there is no real correlation other than it being a form of logic to build something with, but so are Lego blocks and those too are just toys.In fear of going off-topic – this particular discussion would be more relevant in a “Does Scratch really teach programming?” thread – here's my thoughts. Yes, Scratch is a programming tool without the ability to export to a “real-world” audience, and for this reason (among others) it is not a “professional” programming language. But something does not have to be professional to be educational. When you build with Legos, you learn of structure, organization, creativity – all valuable knowledge to have in building real-world structures, as well as throughout many seemingly unrelated parts of life. In the same way, Scratch fosters much of learning programming. Those same topics actually apply – structure, organization, creativity – alongside more concrete things like specific programming concepts, like loops and lists, functions and procedures, multithreading and managing the behavior of multiple objects (sprites, clones). And these are all very useful things to know of when you are programming in any other programming language, whether or not you're in a professional environment.
Hopefully some of this helps you. I'm happy to discuss any of this more – except, perhaps, that last topic. If you want to talk about that, I recommend making a new discussion thread here in the Advanced Topics!
(Edit: formatting typo)
Last edited by _nix (Dec. 26, 2018 17:19:37)
- infinitytec
-
1000+ posts
Scratch 3.0 Technical Discussion
Porting and other languages would be best suited for another topic. I am sure no one hear meant to offend you, and I certainly meant no offense.Let's get back on topic OK?
Everything I have mentioned is relevant and related to Scratch 3.0 technical discussion. I have never left topic.
None of you have answered even a single question other than to antagonize and troll me.
Just because my wording happens to be a little long, that does not make it any less relevant.
It's just that discussions of this nature would best be put in another topic.
Can you at least then please tell me, Once they move the Scratch 2.0 projects to Scratch 3.0, will all ofAll of it will be kept. Only the backpack will be lost.
the projects' Descriptions / Notes and Credits be copied over too? Or do we have to save all that stuff ourselves
if we wish to keep them? ….
The 3.0 site is actually the same as the 2.0 site. The new page designs that have been gradually appearing are part of 3.0. Because of this, this sort of stuff will be able to transfer.
- MabonBaladevaKain
-
100+ posts
Scratch 3.0 Technical Discussion
Thank you _nix. That answered all my questions fairly well.
By Scratch being a toy, I just meant there is no way to stay using Scratch and do real work with it unless you were to make alterations to it.
You just play with it and move on.
But with the ability to save as more common code in some manner it would become much more than a toy.
It could be used as a very nice prototyping tool as well.
I thought I should clarify that. Scratch is a great program or else I would not care if such features existed or not.
Maybe there is some unofficial offline version for those who want such a feature somewhere already, but I just don't know where to get it.
So I ask for such features and hope that maybe someone will come forward with a way to make it happen.
Now for precision of being on-topic's sake and my sheer curiosity, I ask one last question:
Will Scratch 3.0 have a text editor that displays the code that the puzzle blocks already create?
By Scratch being a toy, I just meant there is no way to stay using Scratch and do real work with it unless you were to make alterations to it.
You just play with it and move on.
But with the ability to save as more common code in some manner it would become much more than a toy.
It could be used as a very nice prototyping tool as well.
I thought I should clarify that. Scratch is a great program or else I would not care if such features existed or not.
Maybe there is some unofficial offline version for those who want such a feature somewhere already, but I just don't know where to get it.
So I ask for such features and hope that maybe someone will come forward with a way to make it happen.
Now for precision of being on-topic's sake and my sheer curiosity, I ask one last question:
Will Scratch 3.0 have a text editor that displays the code that the puzzle blocks already create?
- NickyNouse
-
1000+ posts
Scratch 3.0 Technical Discussion
Another point is that the ST probably wants to keep programs hosted on Scratch so that they can be “looked inside” and remixed; the most important part of Scratch is the community aspect. If they let users package projects into standalone apps then new learners wouldn't be able to see what makes those apps tick and learn from them, which defeats the purpose.This isn't a feature the Scratch Team is working on, as far as I know (and I more or less keep track of pretty much all their open source repositories and public discussion). While maybe it's not out of scope of Scratch 3.0 as a programming tool, it makes sense that the Scratch Team seems not to have prioritized the idea at all – their target audience is people who are learning programming, not developing and publishing/selling apps. While there Will we be able to save our Scratch project files as .apk files and sign them easily to make apps for Google Play and/or other app stores?are people like you who want to be able to release projects as easily-distributed binaries (APKs, EXEs, you name it), that just isn't everyone.
Please say yes. It is the only feature that really needs to be added. The rest are not important.
I can't recall if the ST has said anything about SB3 -> EXE. They may have said they're considering it (but do not quote me on that), but I doubt it's something they'd be working on right now, seeing as there's so much else they had to finish before release and there hasn't been any mention of converting Scratch projects to EXEs inside 3.0 FAQ, official ST announcements, etc. (I'm saying -> exe instead of exe/apk because I just cannot remember APK files / android export having been mentioned anywhere before your posts here.)
Judging by the Scratch Team's Github repos, no. But there's an awesome tool called Will Scratch 3.0 have a text editor that displays the code that the puzzle blocks already create?tosh that does that.
- _nix
-
1000+ posts
Scratch 3.0 Technical Discussion
No problem; and I see what you mean now. You're definitely correct that people just couldn't make professional tools with Scratch, purely because Scratch projects can't be exported to a format where they'd be professionally useful. Thank you _nix. That answered all my questions fairly well. …] I just meant…
I actually mentioned something related to this in my post – the fact that Scratch is an interpreted language and not a compiled language. But I'll go into further detail here. Now for precision of being on-topic's sake and my sheer curiosity, I ask one last question:
Will Scratch 3.0 have a text editor that displays the code that the puzzle blocks already create?
Imagine a sprite with several scripts, each starting with hats like “when green flag clicked” and “when I receive” (or any other hat blocks). Each of these scripts are composed of multiple blocks – the hat block as well as any stack and reporter blocks that make up the actual definition of what should happen when the script is active. These blocks are stored as ordinary JavaScript objects that look, more or less, like this:
{ op: "when green flag clicked", children: [ {op: "move steps", inputs: [10]}, { op: "if then", inputs: [ {op: "=", inputs: [{op: "days since 2000"}, 10000]}} ], children: [ {op: "play sound", inputs: ["Bing!"]} ] } ] }
Note that the Scratch VM keeps track of objects that look like the above. That is the “text representation” of the blocks, if you will – and it is the only text representation. While many other programming languages would take a step of compiling those JavaScript objects into a lower-level programming language, such as actual executable JavaScript code, Scratch does not do that; instead it bases a project's behavior directly around those JavaScript objects.
Scratch 3.0 does not have a direct way to edit those JavaScript objects. (Besides being confusing to most users, it would be quite difficult to implement – various different components of 3.0 keep track of those objects and in several different formats, so updating them all at runtime from changes made via a text editor would be relatively complicated.) However, if you download a project onto your computer as an SB3 file, you can rename the to “.zip” and, using your own text editor, modify the contained files – Scratch 2.0 and 3.0 projects are both renamed zip files. You'll want to search for a “project.json” file; this contains the text representation of the entire project.
But, as you might figure, much of the benefit of editing via text is lost in this JavaScript object format. Since the project text is written in a verbose object format, it's difficult to edit. (Even more so in Scratch 3.0 projects, since the example code I showed was an extremely simplified version of how 3.0 projects are stored – they take more of a linked list approach, rather than nesting blocks inside each other.) In fact, virtually anything you might want to do by editing text would simply be faster to do by dragging around blocks!
That said, like NickyNouse suggested, you might be interested in checking out tosh. Keep in mind that when you use it, you're not editing the text representation of the project that the Scratch VM will see – rather, you're editing code that Tosh will compile into the text representations that Scratch can use.