Discuss Scratch

zmjj
Scratcher
2 posts

Leopard: Edit Scratch projects as JavaScript code

I tried to convert this project: https://scratch.mit.edu/projects/817620383/
There was an error: Cannot read properties of undefined (reading ‘name’)
I'm sure there are no unsupported blocks
Can you find the problem?
wyslijp16
Scratcher
4 posts

Leopard: Edit Scratch projects as JavaScript code

Hi @PullJosh !

Thanks for your work on Leopard, it's fabulous ! A little question about it : is the green flag button mandatory or there is an auto-start option ?
PullJosh
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

wyslijp16 wrote:

Hi @PullJosh !

Thanks for your work on Leopard, it's fabulous ! A little question about it : is the green flag button mandatory or there is an auto-start option ?

In the index.html file, you will see some html code that creates the green flag button and some javascript code that makes it so that when you click the button, the project starts. You can edit that code to remove the button and make the project start automatically, for example by using window.onload.
NikoDGreat
Scratcher
37 posts

Leopard: Edit Scratch projects as JavaScript code

Sheep_maker wrote:

PullJosh wrote:

CodeSandbox uses a tool called ESLint to analyze your JavaScript and give you helpful tips to improve your code. Certain rules, like requiring a yield, or using === instead of ==, are usually a good idea, but it makes sense for us to break them so that projects remain compatible with Scratch. I've tried to find a way to turn ESLint off for converted projects but haven't found one.
Perhaps it could be disabled by adding
/* eslint require-yield: "off", eqeqeq: "off" */
to the top of the file, or including an .eslintrc file turning those rules off (idk if the latter works)
/* eslint disable require-yield, eqeqeq */
----toxicDyl----
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

Can it be made possible to convert the WHOLE project?
davidtheplatform
Scratcher
500+ posts

Leopard: Edit Scratch projects as JavaScript code

PullJosh wrote:

wyslijp16 wrote:

Hi @PullJosh !

Thanks for your work on Leopard, it's fabulous ! A little question about it : is the green flag button mandatory or there is an auto-start option ?

In the index.html file, you will see some html code that creates the green flag button and some javascript code that makes it so that when you click the button, the project starts. You can edit that code to remove the button and make the project start automatically, for example by using window.onload.
Note that browsers usually require interaction with a webpage before it can play sound, so if you do this the project might be muted until the user clicks something.

Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.
AntiPiracyKid
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

What about Scratch 4.0?
DifferentDance8
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

AntiPiracyKid wrote:

What about Scratch 4.0?
I have no clue where you even got a hint Scratch 4 is coming out soon. Even if Scratch 4.0 were to come out after the maintenance update (which is more than likely not the case), I'd imagine it'd take a long time for Leopard to update.

“'Common Sense Media' is anything but.” - Za-Chary
zaid1442011
Scratcher
500+ posts

Leopard: Edit Scratch projects as JavaScript code

Bruh Scratch is actually made in JavaScript.

I am a guy who codes weird stuff. Don’t check my GitHub only if you want stupid HTML pages (or something to host them). Check my platformer if you want to see something to see.

Profiles: GitHub.
You won't understand stuff in my signature because I talk about stuff in the ATs (Advanced Topics).
Check out this song for @griffpatch https://scratch.mit.edu/projects/887382049/



WojtekGame
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

zaid1442011 wrote:

Bruh Scratch is actually made in JavaScript.
However Scratch does a lot of things to run a project as seen in the TW docs:

TurboWarp docs wrote:

Whenever Scratch executes any block, it has to do a lot of things:
  • It has to look up the block using its ID and which function the block's opcode corresponds to.
  • If the block has inputs, those are also blocks, and must go through the same steps as any other block, and so must any deeper inputs.
  • It manually maintains a stack of blocks, loops, conditions, procedures, etc.
Scratch scripts can be yielded, so all of this has to happen in a way that can be paused and resumed later.
Scratch scripts can be changed while they're running, so caching everything ahead of time is difficult.
etc. There is a lot going on in Scratch whenever it executes even a single block.

The interpreter overhead is added on top of the overhead of JavaScript itself. As this code involves many dynamic types, it can be hard for the JavaScript JIT to optimize it.
that's why.


forgot to update sig, i own minecraft months ago lol
maybe even a year at this point
tpot_lover2
Scratcher
3 posts

Leopard: Edit Scratch projects as JavaScript code

What is data.sandboxID? My project isn't translating because of it.
AntiPiracyKid
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

OMG DID YOUR ACCOUNT JUST GET HACKED?!?
randopando3443
Scratcher
19 posts

Leopard: Edit Scratch projects as JavaScript code

tpot_lover2 wrote:

What is data.sandboxID? My project isn't translating because of it.
Same.
Creeper_TNT_1234
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

I convert my games into JavaScript but I couldn't play it on my web and the controls were not responding can you help me fix this problem
eei34
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

When I try to upload my project I get this error “Argument sandboxId for data.sandboxId is missing.” can someone help me?
Here is my project: https://scratch.mit.edu/projects/738839342/editor/
isaiah0915
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

through firebase, I could saved cloud data. But I don't know how to get the data.. help please
615ahmet
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

How Can Import to Scratch?
WojtekGame
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

isaiah0915 wrote:

through firebase, I could saved cloud data. But I don't know how to get the data.. help please
can't help other than
https://firebase.google.com/docs

eei34 wrote:

When I try to upload my project I get this error “Argument sandboxId for data.sandboxId is missing.” can someone help me?
Here is my project: https://scratch.mit.edu/projects/738839342/editor/

tpot_lover2 wrote:

What is data.sandboxID? My project isn't translating because of it.

WojtekGame wrote:

tpot_lover2 wrote:

Hi, uh, my projects wont convert it says Argument sandboxId for data.sandboxId is missing. Here is the project ID, plz help.https://scratch.mit.edu/projects/843562348/
yes almost everyone is saying about codesandbox's nor leopard's, so please don't say about
Argument sandboxId for data.sandboxId is missing
again.
literally, no one can help with that


forgot to update sig, i own minecraft months ago lol
maybe even a year at this point
AntiPiracyKid
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

If this works, TurboWarp will be creative!
AntiPiracyKid
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

Powered by DjangoBB