Discuss Scratch

thecoolgguy2013
Scratcher
3 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

thecoolgguy2013 wrote:

Randoming wrote:

Wow, awesome! I don't know any JavaScript so I'm using this to help me learn a bit. Quick question though, how would you make an “if on edge, bounce” function because I kind of need it.
Look below

Last edited by thecoolgguy2013 (Feb. 25, 2024 23:14:46)

thecoolgguy2013
Scratcher
3 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

DO this Script
if (/* this.touching(“edge”) */) {
//bounce (maybe)

I hope this helped and I don't know as much so sorry if it doesn't work
BOMZIKA22
Scratcher
10 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Scratch is the best thing ever!!

hi @griffpatch i am a scratcher and i love your videos
DARKGAMES1951
Scratcher
17 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Mine wont convert, it keeps saying "Cannot read properties of undefined (reading ‘name’)"
A_Nyan_In_Space
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Error:
There was an error converting your project.

Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(Error { kind: Db, cause: Some(DbError { severity: “ERROR”, parsed_severity: Some(Error), code: SqlState(E42P05), message: “prepared statement \”s0\“ already exists”, detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some(“prepare.c”), line: Some(446), routine: Some(“StorePreparedStatement”) }) }) })

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!
Project: https://scratch.mit.edu/projects/855232789/
s_federici
Scratcher
500+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

swzler
Scratcher
14 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

DARKGAMES1951 wrote:

Mine wont convert, it keeps saying "Cannot read properties of undefined (reading ‘name’)"
yeah

-swzler
Gaty1101
Scratcher
7 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

here's my if on edge bounce block replacement
if (this.y > 180 || this.y < -180 || this.x > 240 || this.x < -240) {
this.direction += 180;
Pillagerplayz
Scratcher
54 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Why does it not support extensions other than pen! Scratch was coded with JavaScript! The extensions were coded with JavaScript!
PullJosh
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Fun news! Thanks to some hard work from HanClinto, towerofnix, and adroitwhiz, we now support the “if on edge, bounce” block!

if on edge, bounce

This completes our support for the Scratch “motion” category! All motion blocks are now supported in Leopard.
alwayspaytaxes
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

PullJosh wrote:

Fun news! Thanks to some hard work from HanClinto, towerofnix, and adroitwhiz, we now support the “if on edge, bounce” block!

if on edge, bounce

This completes our support for the Scratch “motion” category! All motion blocks are now supported in Leopard.
Great job keeping this project active for all these years!

Pillagerplayz wrote:

Why does it not support extensions other than pen! Scratch was coded with JavaScript! The extensions were coded with JavaScript!
Scratch uses a JavaScript library called the Scratch VM. Extensions in Scratch are written to work with the Scratch VM. Leopard does not use the Scratch VM, at least to my knowledge

-\{:)_/-

play sound [bad to the bone riff.wav v]
poptko
Scratcher
78 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

I am trying to load a Scrolling Platformer Engine made by @griffpatch but it says a error


Support the suggestion HERE by adding this button to your signature
T33n_T1t4n5
Scratcher
18 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

poptko wrote:

I am trying to load a Scrolling Platformer Engine made by @griffpatch but it says a error
same here. it doesn't give me an error but it stays stuck on the loading swirly when I upload the project file
Jaim_animation
Scratcher
70 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

GUYS STOP REPORTING THE SAME ERROR LEOPARD TEAM KNOWS IT!

Hope It Helps!

—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection

scratch blue infection! try to prevent it, but how?
Brickwall777
Scratcher
55 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Leopard.js won't upload my project. It was made in 3.0, last week in fact. No idea what's wrong.

https://scratch.mit.edu/projects/977649640/
gdxfor
Scratcher
100+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Brickwall777 wrote:

Leopard.js won't upload my project. It was made in 3.0, last week in fact. No idea what's wrong.

https://scratch.mit.edu/projects/977649640/
It's because there's no support for the "stop [other scripts in sprite v]" block

Last edited by gdxfor (March 11, 2024 23:51:24)

betazone
New to Scratch
3 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

Followed your examples on the sb-edit github page. Was able to get code from .sb3 file using your call to project.toLeopard({ printWidth: 100 }).
Looking at the code for the toLeopard function, looks like there are options for extracting costumes, backdrops and sounds.
Is that possible and if so, how would I set the options for the call to toLeopard to do it?
PullJosh
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

betazone wrote:

Followed your examples on the sb-edit github page. Was able to get code from .sb3 file using your call to project.toLeopard({ printWidth: 100 }).
Looking at the code for the toLeopard function, looks like there are options for extracting costumes, backdrops and sounds.
Is that possible and if so, how would I set the options for the call to toLeopard to do it?
What do you mean by “extracting” costumes, backdrops, and sounds?
CoderCat322
Scratcher
12 posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

It says sometimes it messes up converting when your game uses pen. Is this true?
PullJosh
Scratcher
1000+ posts

Leopard: Convert Scratch projects to JavaScript AUTOMATICALLY!

CoderCat322 wrote:

It says sometimes it messes up converting when your game uses pen. Is this true?
Pen blocks shouldn't cause an issue. Other extensions might be a problem, but pen is fully supported. Are you seeing any pen-related errors when you try to convert your project?

Powered by DjangoBB