Discuss Scratch

Sheep_maker
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

mazzadoobry wrote:

PullJosh wrote:

[…]

So wait(1); in leopard is setTimeout(myFunction, 1000); in Javascript?
Not necessarily since JavaScript's setTimeout is different from Scratch's wait _ seconds block. I believe with a wait time of zero, setTimeout waits ~4 ms while Scratch waits one frame, or ~1/30 seconds (~33 ms). Using native setTimeout might also be slightly unreliable when running other scripts at the same time. Also, using callbacks are a bit difficult to use inside loops; in a JavaScript async function, you might instead typically do “await new Promise(resolve => setTimeout(resolve, 1000))” (or write a helper function for this)
doublebox
Scratcher
19 posts

Leopard: Edit Scratch projects as JavaScript code

First off, how do i make it go 60fps and how do i change the stage size
jeehu
Scratcher
30 posts

Leopard: Edit Scratch projects as JavaScript code

(long unnecessary quote removed by moderator - please don't spam)

Use turbowarp packager by garbomuffin. It is better

Last edited by Paddle2See (Sept. 1, 2021 15:14:45)

kccuber
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

jeehu wrote:

Use turbowarp packager by garbomuffin. It is better
you don't learn how javascript works from turbowarp packager
-089-
Scratcher
66 posts

Leopard: Edit Scratch projects as JavaScript code

can someone tell me what this

{“error”:"This endpoint requires the params `files` or `parameters` in order to work. See https://codesandbox.io/docs/importing#create-wizard for more details.“}

means? after clicking on ”edit as javascript" I got redirected to https://codesandbox.io/api/v1/sandboxes/define where the message above appeared.
I was trying to convert this project https://scratch.mit.edu/projects/454347522/ if that helps anything.
PullJosh
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

-089- wrote:

can someone tell me what this

{“error”:"This endpoint requires the params `files` or `parameters` in order to work. See https://codesandbox.io/docs/importing#create-wizard for more details.“}

means? after clicking on ”edit as javascript" I got redirected to https://codesandbox.io/api/v1/sandboxes/define where the message above appeared.
I was trying to convert this project https://scratch.mit.edu/projects/454347522/ if that helps anything.
As far as I can tell, that error appears when a project contains weird sprite or costume names. For example, your sprite “compressed file” has some strange symbols in its costume names.

Leopard should handle this gracefully, but it currently doesn't. If you want to make the translation work, you'll have to change those names.
crawly_coder_15
Scratcher
17 posts

Leopard: Edit Scratch projects as JavaScript code

jeehu wrote:

(long unnecessary quote removed by moderator - please don't spam)

Use turbowarp packager by garbomuffin. It is better

Or you can use scratch packager. Also made by garbomufffin. But turbowrap packeger is better. I still prefer leopard though

Fun fact: garbomuffin made turbowarp
crawly_coder_15
Scratcher
17 posts

Leopard: Edit Scratch projects as JavaScript code

PullJosh wrote:

Maximouse wrote:

mazzadoobry wrote:

Some of the translations in leopard to js are not real javascript code right?
They're all real JavaScript, but some require Leopard's library.
This is correct. Leopard provides some built-in functions, which are a bit like “My Blocks” in Scratch. Essentially, we use regular JavaScript code to create some additional functionality for you, and then your project can use that.

So it's all real JavaScript code, but Leopard is doing a lot of the hard work for you.

What’s leopards library plug-in js?

ego-lay_atman-bay
Scratcher
500+ posts

Leopard: Edit Scratch projects as JavaScript code

how do I convert a project from my computer in leopard.js?
kccuber
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

ego-lay_atman-bay wrote:

how do I convert a project from my computer in leopard.js?
i guess you can upload it to an unshared project and link that

Last edited by kccuber (Sept. 4, 2021 19:45:21)

ego-lay_atman-bay
Scratcher
500+ posts

Leopard: Edit Scratch projects as JavaScript code

kccuber wrote:

ego-lay_atman-bay wrote:

how do I convert a project from my computer in leopard.js?
i guess you can upload it to an unshared project and link that
about that… my project exceeds the scratch size limit, so I can't.
RoboBoy3
Scratcher
20 posts

Leopard: Edit Scratch projects as JavaScript code

There was an error converting your project.
Cannot read property ‘author’ of undefined
Leopard only supports new projects (created in Scratch 3.0). And the only supported extension is “pen”; all others will fail.
If you aren't sure why your project is failing, ask on the forums!

My project does not use pen nor any scratch extensions, but it's saying this error

Avrothestickman
Scratcher
95 posts

Leopard: Edit Scratch projects as JavaScript code

Would be cool if people could learn js
Verixion
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

Avrothestickman wrote:

Would be cool if people could learn js
Most ATers know JS, it's a simple programming language
RokCoder
Scratcher
1000+ posts

Leopard: Edit Scratch projects as JavaScript code

Verixion wrote:

Avrothestickman wrote:

Would be cool if people could learn js
Most ATers know JS, it's a simple programming language
That's just plain wrong. Even Scratch wouldn't be described as easy if/when you're trying to do extremely complex or performant things with it. When you've picked up one computer language, picking up more becomes easier but it still depends on how deep into the language you want to go and/or what you want to use the language for. Using JS for simple things is relatively easy. Using it for complex things isn't.
yunus4040
Scratcher
30 posts

Leopard: Edit Scratch projects as JavaScript code

Good I think this is a awesome way for Scratcher's to improve in programing and learn other programing languages like java-script
NorthenSuperCoders
Scratcher
100+ posts

Leopard: Edit Scratch projects as JavaScript code

I Love that!! Great!!
shonsh
Scratcher
1 post

Leopard: Edit Scratch projects as JavaScript code

great job

That would be nice,
If it will be possible to access variables, messages, … from outside the project.
(Assuming you know the names)
Xx_YeetMasterXx
Scratcher
45 posts

Leopard: Edit Scratch projects as JavaScript code

I will try it lol
Ciyob86
Scratcher
500+ posts

Leopard: Edit Scratch projects as JavaScript code

{"error":"This endpoint requires the params `files` or `parameters` in order to work. See https://codesandbox.io/docs/importing#create-wizard for more details."}

Last edited by Ciyob86 (Sept. 16, 2021 19:33:33)

Powered by DjangoBB