Discuss Scratch

mazzadoobry
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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.

So wait(1); in leopard is setTimeout(myFunction, 1000); in Javascript?

I like scratch.
I would never say
I don't like scratch.

Lol read from top to bottom, then bottom to top.

window.document.getElementById(“follow-button”).addEventListener(click, clicked)

function clicked() {
console.log(“Thank you!”)
alert(“Lol”)
}

CANVAS IS A CONTAINER FOR GRAPHICS
Sheep_maker
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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)

- 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; }
doublebox
Scratcher
19 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

(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)


when green flag clicked
if <mouse down?> then
say [I love henry stickmin!]
end
kccuber
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

jeehu wrote:

Use turbowarp packager by garbomuffin. It is better
you don't learn how javascript works from turbowarp packager


Made using Nord Theme & Inkscape
-089-
Scratcher
1 post

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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: Convert Scratch projects to JavaScript AUTOMATICALLY!

-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: Convert Scratch projects to JavaScript AUTOMATICALLY!

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

search with ecosia.org to plant trees by you just searching! we need to save our world!
move (search) steps
move (plant tree) steps
crawly_coder_15
Scratcher
17 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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?


search with ecosia.org to plant trees by you just searching! we need to save our world!
move (search) steps
move (plant tree) steps
ego-lay_atman-bay
Scratcher
500+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

how do I convert a project from my computer in leopard.js?

Hi, I'm ego-lay_atman-bay. Please check out these projects.
kccuber
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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)



Made using Nord Theme & Inkscape
ego-lay_atman-bay
Scratcher
500+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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.

Hi, I'm ego-lay_atman-bay. Please check out these projects.
RoboBoy3
Scratcher
20 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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


Try Out Ecosia! A search Engine that can save the Future!
Avrothestickman
Scratcher
95 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Would be cool if people could learn js

Making an Ace Combat 7 fangame on scratch.
Verixion
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Avrothestickman wrote:

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

back in business

RokCoder
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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.


Scratch dabbling for fun…

yunus4040
Scratcher
30 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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

<script type=“text/javascript”>
function getInspiration(morningDay) {
if (morningDay === “morning” && boredomLevel === “bored”) {
startCoding();
getAwesome();
}
}
function startCoding() {
// Your code to start coding goes here.
}
function getAwesome() {
// Your code to get inspired goes here.
}
</script>

NorthenSuperCoders
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

I Love that!! Great!!

NorthenSuperCoders
A self-programmer - also writes books, him self.
===================================================
shonsh
Scratcher
1 post

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

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: Convert Scratch projects to JavaScript AUTOMATICALLY!

I will try it lol

Xx_YeetMasterXx - 3+ Years Of Scratching - Forum Helper

Powered by DjangoBB