Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Convert scratch game to python
- nicochulo2001
-
Scratcher
9 posts
Convert scratch game to python
It's been a long time since I last checked this thread and I saw this comment and was intrigued by its potential. I know close to nothing about JS, so my question is: Would I be able to run basic python code with Sulfurous? Since I want to interact with the computer itself (and not a website) I wanted to know if Sulfurous can directly (or indirectly) run python code, or if it is only able to run JS code. And if it is possible to run python code, I wanted to know if I'm able to download the project from Sulfurous, because I doubt it will be able to interact with the computer if I simply embed it to a website (for example I want to be able to change the desktop image and such, which would be close to impossible with plain JS as far as I know)Yeah that'd be coolOk I get what you're saying, but I wanted to link events in-game to the computer. Say I make a game and I want to add a link that, when clicked, actually sends me to the website. That kind of thing obviously can't be done with Scratch, and it requires a code that (once downloaded) can be modified to implement such functionalities (that's why I wanted raw Python, because then I could easily link events and variables to websites or to other programs), so if you know a simpler way to acomplish this (like a conversion to another language or another tool that allows this kind of interactions) let me knowNo, that makes a lot of sense. I hadn't really thought of that possibility before.
Something that might be cool to pursue is a Scratch-to-something converter that does this automatically–i.e. you could use some specific custom blocks in Scratch that would be converted into things that Scratch itself doesn't support.
Also if you (or someone reading) know how to do that, even if it uses another language (like say C++ or something) then let me know, because the functions I want to add are simple and I'd simply need to modify a few things and compile it into some sort of .exe
This could probably been done by running the Scratch project in Sulfurous and adding custom code withsulf.script [...your code here...]
define sulf.script [text]
Last edited by nicochulo2001 (Oct. 22, 2018 13:19:28)
- boyzee3
-
Scratcher
25 posts
Convert scratch game to python
Hey, just came across this thread. Sulfurous is just a modified version of phosphorous. All it does is convert Scratch projects into JavaScript, so there's no Python compatability there. I am currently working on a “Scratch to Python” library for python, which will enable you to turn “.sb3” files into “.py” files using python 3 and tkinter. It will also allow for relatively easy modification of the source code, and for you to write python games using the same commands as Scratch gives you.It's been a long time since I last checked this thread and I saw this comment and was intrigued by its potential. I know close to nothing about JS, so my question is: Would I be able to run basic python code with Sulfurous? Since I want to interact with the computer itself (and not a website) I wanted to know if Sulfurous can directly (or indirectly) run python code, or if it is only able to run JS code. And if it is possible to run python code, I wanted to know if I'm able to download the project from Sulfurous, because I doubt it will be able to interact with the computer if I simply embed it to a website (for example I want to be able to change the desktop image and such, which would be close to impossible with plain JS as far as I know)Yeah that'd be coolOk I get what you're saying, but I wanted to link events in-game to the computer. Say I make a game and I want to add a link that, when clicked, actually sends me to the website. That kind of thing obviously can't be done with Scratch, and it requires a code that (once downloaded) can be modified to implement such functionalities (that's why I wanted raw Python, because then I could easily link events and variables to websites or to other programs), so if you know a simpler way to acomplish this (like a conversion to another language or another tool that allows this kind of interactions) let me knowNo, that makes a lot of sense. I hadn't really thought of that possibility before.
Something that might be cool to pursue is a Scratch-to-something converter that does this automatically–i.e. you could use some specific custom blocks in Scratch that would be converted into things that Scratch itself doesn't support.
Also if you (or someone reading) know how to do that, even if it uses another language (like say C++ or something) then let me know, because the functions I want to add are simple and I'd simply need to modify a few things and compile it into some sort of .exe
This could probably been done by running the Scratch project in Sulfurous and adding custom code withsulf.script [...your code here...]
define sulf.script [text]
- nicochulo2001
-
Scratcher
9 posts
Convert scratch game to python
I just check this thread from time to time (unfortunately not very regularly) and coming across this comment is amazing. tkinter is also a great choice as it allows a huge range of possibilities regarding window size, location and interaction. I haven't programmed in python for a long time but if I recall correctly there was even an option to make the “close” icon dissapear from any tkinter window. By all means, keep me up to date on this library and tell me where to get updates on its progressHey, just came across this thread. Sulfurous is just a modified version of phosphorous. All it does is convert Scratch projects into JavaScript, so there's no Python compatability there. I am currently working on a “Scratch to Python” library for python, which will enable you to turn “.sb3” files into “.py” files using python 3 and tkinter. It will also allow for relatively easy modification of the source code, and for you to write python games using the same commands as Scratch gives you.It's been a long time since I last checked this thread and I saw this comment and was intrigued by its potential. I know close to nothing about JS, so my question is: Would I be able to run basic python code with Sulfurous? Since I want to interact with the computer itself (and not a website) I wanted to know if Sulfurous can directly (or indirectly) run python code, or if it is only able to run JS code. And if it is possible to run python code, I wanted to know if I'm able to download the project from Sulfurous, because I doubt it will be able to interact with the computer if I simply embed it to a website (for example I want to be able to change the desktop image and such, which would be close to impossible with plain JS as far as I know)Yeah that'd be coolOk I get what you're saying, but I wanted to link events in-game to the computer. Say I make a game and I want to add a link that, when clicked, actually sends me to the website. That kind of thing obviously can't be done with Scratch, and it requires a code that (once downloaded) can be modified to implement such functionalities (that's why I wanted raw Python, because then I could easily link events and variables to websites or to other programs), so if you know a simpler way to acomplish this (like a conversion to another language or another tool that allows this kind of interactions) let me knowNo, that makes a lot of sense. I hadn't really thought of that possibility before.
Something that might be cool to pursue is a Scratch-to-something converter that does this automatically–i.e. you could use some specific custom blocks in Scratch that would be converted into things that Scratch itself doesn't support.
Also if you (or someone reading) know how to do that, even if it uses another language (like say C++ or something) then let me know, because the functions I want to add are simple and I'd simply need to modify a few things and compile it into some sort of .exe
This could probably been done by running the Scratch project in Sulfurous and adding custom code withsulf.script [...your code here...]
define sulf.script [text]
- SmySimon
-
Scratcher
44 posts
Convert scratch game to python
add a folder call “test.s2e”
press shift and “file”
choose the “import experimental HTTP extension”
choose “test.s2e”
you can see a block in “More blocks”
(the picture can't show)
just type the code like that
and you can see some blocks in it
press shift and “file”
choose the “import experimental HTTP extension”
choose “test.s2e”
you can see a block in “More blocks”
(the picture can't show)
just type the code like that
and you can see some blocks in it
- boyzee3
-
Scratcher
25 posts
Convert scratch game to python
I just check this thread from time to time (unfortunately not very regularly) and coming across this comment is amazing. tkinter is also a great choice as it allows a huge range of possibilities regarding window size, location and interaction. I haven't programmed in python for a long time but if I recall correctly there was even an option to make the “close” icon dissapear from any tkinter window. By all means, keep me up to date on this library and tell me where to get updates on its progressHey, just came across this thread. Sulfurous is just a modified version of phosphorous. All it does is convert Scratch projects into JavaScript, so there's no Python compatability there. I am currently working on a “Scratch to Python” library for python, which will enable you to turn “.sb3” files into “.py” files using python 3 and tkinter. It will also allow for relatively easy modification of the source code, and for you to write python games using the same commands as Scratch gives you.It's been a long time since I last checked this thread and I saw this comment and was intrigued by its potential. I know close to nothing about JS, so my question is: Would I be able to run basic python code with Sulfurous? Since I want to interact with the computer itself (and not a website) I wanted to know if Sulfurous can directly (or indirectly) run python code, or if it is only able to run JS code. And if it is possible to run python code, I wanted to know if I'm able to download the project from Sulfurous, because I doubt it will be able to interact with the computer if I simply embed it to a website (for example I want to be able to change the desktop image and such, which would be close to impossible with plain JS as far as I know)Yeah that'd be coolOk I get what you're saying, but I wanted to link events in-game to the computer. Say I make a game and I want to add a link that, when clicked, actually sends me to the website. That kind of thing obviously can't be done with Scratch, and it requires a code that (once downloaded) can be modified to implement such functionalities (that's why I wanted raw Python, because then I could easily link events and variables to websites or to other programs), so if you know a simpler way to acomplish this (like a conversion to another language or another tool that allows this kind of interactions) let me knowNo, that makes a lot of sense. I hadn't really thought of that possibility before.
Something that might be cool to pursue is a Scratch-to-something converter that does this automatically–i.e. you could use some specific custom blocks in Scratch that would be converted into things that Scratch itself doesn't support.
Also if you (or someone reading) know how to do that, even if it uses another language (like say C++ or something) then let me know, because the functions I want to add are simple and I'd simply need to modify a few things and compile it into some sort of .exe
This could probably been done by running the Scratch project in Sulfurous and adding custom code withsulf.script [...your code here...]
define sulf.script [text]
Yo! My work on the library is on and off, haven't touched it for quite a while but might get back to it soon ish. You can check out the code at https://github.com/dantechguy/stop but the code isn't 100% bug tested and I haven't written very much documentation. You're welcome to look at the source files (if you go to the github, then in files you go: package>stop>sprite_code.py contains all of the functions you can currently do). It's pretty janky, but I'll keep posting updates here every now and again. You're welcome to email me at the email listed on my github for any questions or concerns.
- boyzee3
-
Scratcher
25 posts
Convert scratch game to python
Follow up from my previous post, I am now developing a version 2 of my Scratch to Python converter, using Qt instead of tkinter. The link above still works, but I'm considering making the converter online for ease-of-access. This one should be much better with cleaner instructions once finished
- epicman127
-
New Scratcher
1 post
Convert scratch game to python
I know this thread is dead, but.
How is the project going? Is it finished?
How is the project going? Is it finished?
- tejassamurai
-
Scratcher
44 posts
Convert scratch game to python
I know this thread is dead, but.Yeah, I'd like to hear that too!
How is the project going? Is it finished?
- mumu245
-
Scratcher
1000+ posts
Convert scratch game to python
Try this link to convert the project to HTMLWhy exactly do you want to convert a Scratch game to Python?Ok I get what you're saying, but I wanted to link events in-game to the computer. Say I make a game and I want to add a link that, when clicked, actually sends me to the website. That kind of thing obviously can't be done with Scratch, and it requires a code that (once downloaded) can be modified to implement such functionalities (that's why I wanted raw Python, because then I could easily link events and variables to websites or to other programs), so if you know a simpler way to acomplish this (like a conversion to another language or another tool that allows this kind of interactions) let me know
If you want to get a version of your game that can be executed externally to Scratch, there are better solutions than Python, although I'm not entirely sure where they might be these days.
If you're hoping to learn about Python, I'm afraid that such a conversion probably wouldn't help you much–any Scratch to Python converter will probably have some weird stuff in it, simply because of intractable differences between the languages. For example, it's pretty idiomatic in Scratch to have a bunch of separate threads, while that's not really idiomatic in Python.
Last edited by mumu245 (Nov. 12, 2020 17:58:13)
- gamer_Jamie2
-
Scratcher
3 posts
Convert scratch game to python
There was apparently suppost to be a Python Mode in Scratch 3 but it was scrapped i guess because when i heard about it I looked basically EVERYWHERE! Cant find it though.
Last edited by gamer_Jamie2 (Jan. 31, 2022 17:55:28)
- r_mario
-
Scratcher
20 posts
Convert scratch game to python
There was apparently suppost to be a Python Mode in Scratch 3 but it was scrapped i guess because when i heard about it I looked basically EVERYWHERE! Cant find it though.Aww. I wished you found it, because I need a Scratch to Python convertion block
- ToastersUnited
-
Scratcher
1000+ posts
Convert scratch game to python
Godot has GDscript which uses a very similar syntaxYou could use CoRo Scratch by BookOwl it should transpile your scratch project to python. All of the graphics parts of your code could be replaced by pygame function calls.I've tried this tool and (as you told me) it yielded a graphic-less code, but it's also a control-less one. I think this tool is designed with text-based games in mind. I'm very nooby at python, so I don't know how to place in textures and controls, even after watching a few pygame tutorials, so maybe I should abandon the idea before I go insane, because trying to integrate controls and textures in a code I don't understand sounds like a very bad idea. Thanks anyways.
Oh and also, is there like a 100% python game engine? Because I know that game engines are easy to manage, and if there's a game engine (that uses pygame of any other gaming related library) that literally outputs a .py file that would help me a lot. Even if it outputs a python executable I could probably edit some of the code
- gundam3432
-
Scratcher
9 posts
Convert scratch game to python
how to convert or remake scratch games into python?
- Discussion Forums
- » Advanced Topics
-
» Convert scratch game to python