Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Leopard: Edit Scratch projects as JavaScript code
- Pr_Testing
-
8 posts
Leopard: Edit Scratch projects as JavaScript code
PullJosh how are u so clever
- Remixer56
-
52 posts
Leopard: Edit Scratch projects as JavaScript code
One of my projects did not work: https://scratch.mit.edu/projects/363945491/
Scratch on,
Remixer56
- -InsanityPlays-
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
It's called forkphorus not phosphorus now. And btw does it have dark mode?
Welcome to my signature!
I've moved accounts. Anyway, did this post help you? Go follow me on my new account!
Today's Links: Scratch 4.0 Leaked Information, Astronomical - The Third, The Forum Community
follow me on scratch or i am sad, subscribe to my YouTube channel or bad luck for the rest of your life
My Final Shoutout: hekcer because in computer science class, he is the hekcerman
-InsanityPlays- Fan Studio! (closed) | Astronomical - The Third | Best of -InsanityPlays- 2020
my channel, my website, ctrl+shift+down for more STUFF
I've moved accounts. Anyway, did this post help you? Go follow me on my new account!
Today's Links: Scratch 4.0 Leaked Information, Astronomical - The Third, The Forum Community
follow me on scratch or i am sad, subscribe to my YouTube channel or bad luck for the rest of your life
My Final Shoutout: hekcer because in computer science class, he is the hekcerman
-InsanityPlays- Fan Studio! (closed) | Astronomical - The Third | Best of -InsanityPlays- 2020
my channel, my website, ctrl+shift+down for more STUFF
![](https://u.cubeupload.com/InsanityPlays/AHGpli.png)
2020's Advent Collection:
![](https://u.cubeupload.com/InsanityPlays/1HK7bB.png)
more STUFF
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/smile.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/neutral.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/sad.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/big_smile.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/yikes.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/wink.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/hmm.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/tongue.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/lol.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/mad.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/roll.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__8ab925caab77449721bff2021ee3fc43__/djangobb_forum/img/smilies/cool.png)
- BearSlothCoding
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
No, those are two separate things, Forkphorus is based off of Phosphorus. And Forkphorus has it but Phosphrous doesn't. Also, this is for Leopard, not Forkphorus or Phosphorus. It's called forkphorus not phosphorus now. And btw does it have dark mode?
Yes, I made sure I said both Forkphorus and Phosphorus in each sentence.
- Pr_Testing
-
8 posts
Leopard: Edit Scratch projects as JavaScript code
ur definitely one of em!PullJosh how are u so cleverIt isn't just me!
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/big_smile.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/tongue.png)
- theXliner
-
83 posts
Leopard: Edit Scratch projects as JavaScript code
Hmm I have a VERY MINOR suggestion:
Could you make a Python3 API? I mostly code python, and is currently trying to understand Swift & C++. JavaScript/Other languages are on the bottom of my list. So a Python3 API for sh-edit would be nice.
Could you make a Python3 API? I mostly code python, and is currently trying to understand Swift & C++. JavaScript/Other languages are on the bottom of my list. So a Python3 API for sh-edit would be nice.
- apple502j
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
Maybe I can make it - but let me fix some bugs in parse-sb3-blocks first Hmm I have a VERY MINOR suggestion:
Could you make a Python3 API? I mostly code python, and is currently trying to understand Swift & C++. JavaScript/Other languages are on the bottom of my list. So a Python3 API for sh-edit would be nice.
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/tongue.png)
署名は、ディスカッションフォーラムの機能である。署名は、その人のすべての投稿の下部に追加される。署名は、BBCodeで記述できる。 署名を追加/変更/削除したい場合は、ディスカッションフォーラムのホームの一番下に行き、「Change your signature」を押す。署名の大きさは150pxまでである。これには、改行、画像を含む。- Japanese Scratch-Wiki 「署名」
- DecaTen
-
4 posts
Leopard: Edit Scratch projects as JavaScript code
I've noticed that the trigonometric functions do not take Scratch's 90 degree offset into account.
- theXliner
-
83 posts
Leopard: Edit Scratch projects as JavaScript code
I'm making one right now! It's a private GitHub repo for now. If you have a GitHub account, tell me your username! Then we could work on this together. The thing is, I plan to make it pure python. It is basically scratch-to-pygame.Maybe I can make it - but let me fix some bugs in parse-sb3-blocks first Hmm I have a VERY MINOR suggestion:
Could you make a Python3 API? I mostly code python, and is currently trying to understand Swift & C++. JavaScript/Other languages are on the bottom of my list. So a Python3 API for sh-edit would be nice.
EDIT: I also use Atom, so we can use the Teletype ability. I'm also working on parsing the JSON to tokens, so any language can benefit. Psst, I only know python thoroughly.
Last edited by theXliner (July 8, 2020 16:42:15)
- Pr_Testing
-
8 posts
Leopard: Edit Scratch projects as JavaScript code
call it purrrI'm making one right now! It's a private GitHub repo for now. If you have a GitHub account, tell me your username! Then we could work on this together. The thing is, I plan to make it pure python. It is basically scratch-to-pygame.Maybe I can make it - but let me fix some bugs in parse-sb3-blocks first Hmm I have a VERY MINOR suggestion:
Could you make a Python3 API? I mostly code python, and is currently trying to understand Swift & C++. JavaScript/Other languages are on the bottom of my list. So a Python3 API for sh-edit would be nice.
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/tongue.png)
- PullJosh
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
I've noticed that the trigonometric functions do not take Scratch's 90 degree offset into account.Good catch! The issue is actually that the trig functions do use Scratch's directional system when they should use regular degrees (where 0 = right).
I've updated Leopard so that this is no longer an issue.
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/smile.png)
- Bears8
-
9 posts
Leopard: Edit Scratch projects as JavaScript code
This is great!. I've noticed that some of my projects don't work with leopard. When the code is converted nothing happens and it just remains a black screen. Then when I click “Edit as javascript” it has me download “codesandbox.json”
- BamBozzle
-
3 posts
Leopard: Edit Scratch projects as JavaScript code
Very impressive my guy! Well done! I just want to highlight that this monstrosity doesn't work on it (https://scratch.mit.edu/projects/395414289/) although I don't recommend filtering through all the 4000ish blocks but if youre interested ![](//cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/smile.png)
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/smile.png)
- theXliner
-
83 posts
Leopard: Edit Scratch projects as JavaScript code
How does sb-edit work? Which JSON does it get input from? The unzipped sb3 or the project.scratch link? Because I want to fork that JavaScript into return a list of tokens which then anyone can parse.
- Sheep_maker
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
https://scratch.mit.edu/projects/395414289/) although I don't recommend filtering through all the 4000ish blocks but if youre interestedIt seems that in Sprite1's Map custom block, it's trying to get item rm of map1, but since rm starts at zero and hasn't yet been changed, it tries to get the length of a nonexistent string item in the list, which throws an error in JS Very impressive my guy! Well done! I just want to highlight that this monstrosity doesn't work on it (
*map() { this.stage.vars.rm = 0; for (let i = 0; i < this.stage.vars.map1.length + 1; i++) { this.stage.vars.rl = 0; for ( let i = 0; i < this.stage.vars.map1[this.stage.vars.rm - 1].length + 1; // ^^^^^^ // TypeError: Cannot read property 'length' of undefined i++ ) {
I wonder if Leopard will be hip and modern and use the optional chaining operator ?. to avoid this
You can use Project.fromSb3 and pass in a buffer of the zipped .sb3 file or Project.fromSb3JSON with the project.json from projects.scratch.mit.edu How does sb-edit work? Which JSON does it get input from? The unzipped sb3 or the project.scratch link? Because I want to fork that JavaScript into return a list of tokens which then anyone can parse.
Last edited by Sheep_maker (July 8, 2020 19:42:30)
- 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; }
- PullJosh
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
That's interesting. This is great!. I've noticed that some of my projects don't work with leopard. When the code is converted nothing happens and it just remains a black screen. Then when I click “Edit as javascript” it has me download “codesandbox.json”
![](http://cdn.scratch.mit.edu/scratchr2/static/__4f1f321e080ee4987f163566ecc0dd26__/djangobb_forum/img/smilies/hmm.png)
- PullJosh
-
1000+ posts
Leopard: Edit Scratch projects as JavaScript code
I updated the first post with this new section called “Upcoming Improvements”.
Upcoming ImprovementsHave I sorted these priorities correctly? I'd love to hear any comments you might have.
Based on the feedback I'm seeing on the forums and in comments, these are the top-priority issues to solve (most important first):
- Sprite layering doesn't work! go to front/back & go forward/backward blocks need to be implemented.
- Projects run too fast! Leopard projects currently run at 60fps, but it should also be possible to slow them down to 30fps.
- If touching edge and if on edge, bounce blocks don't work.
- Lots of little bugs that all add up to cause issues
- Discussion Forums
- » Advanced Topics
-
» Leopard: Edit Scratch projects as JavaScript code