Discuss Scratch

Display-Games
Scratcher
2 posts

Scratch 3 to Python Tool

Hello everyone! I am working on a Scratch 3 to Pygame (Python game) converter!

Here is an example of what the converter can do:
ifmousex=100thenmove10steps



if pygame.mouse.get_pos()[0] == 100:
Sprite1.pos_x += 10


Currently, the converter is a work in progress. So far, it can read Scratch 3 projects (unzipped .sb3 files), rip assets and code and somewhat find python equivalents for the code.

Please let me know if you would like to use this tool in the future, test it or help/contribute (P.S. the tool is written in Python).

UPDATE: Here is the github page if anyone is interested: github.com/lukarao/sb3-to-py

Last edited by Display-Games (Dec. 16, 2020 22:16:02)

Maximouse
Scratcher
1000+ posts

Scratch 3 to Python Tool

Display-Games wrote:

if pygame.mouse.get_pos() == pygame.mouse.get_pos():
You probably meant if pygame.mouse.get_pos()[0] == 100:.

Last edited by Maximouse (Dec. 10, 2020 09:27:42)

Display-Games
Scratcher
2 posts

Scratch 3 to Python Tool

Maximouse wrote:

Display-Games wrote:

if pygame.mouse.get_pos() == pygame.mouse.get_pos():
You probably meant if pygame.mouse.get_pos()[0] == 100:.

Thank you for the correction. In the code it looks like that but I guess I forgot to include it in the forum post.
Wackyduck2020
Scratcher
100+ posts

Scratch 3 to Python Tool

OOOOOOOOO
This looks coolio
celleron56
Scratcher
89 posts

Scratch 3 to Python Tool

thank you now i do not have to worry about rewriting to much of crucially important scripts (scripts like eagle DB that i always use in scratch projects )
also i found that it errored out (converting a base project with the stamp block being the prime suspect)
with this project download link for sb3 file i tried to convert (as data URL )

Last edited by celleron56 (April 17, 2022 04:39:32)

Powered by DjangoBB