Scratch question
-
I couldn't get the XBoxDrv to work so I jused QJoyPad: http://qjoypad.sourceforge.net/doc/doc_index.html
and that worked. So even if this doesn't work on RetroPie, you can use the QJoyPad for Scratch games on the desktop.But it's still slow on a Pi 3. Even a simple game like https://scratch.mit.edu/projects/146916513/
-
So I'm not sure if I messed up my X system and that's why it doesn't work on RetroPie or if it just does not work on RetroPie. I'm guessing it's my X system since Minecraft Pi doesn't want to work either even though it worked before. So I'm doing a clean install on another SD card to see if it works better.
-
Nope, it just isn't working. Well, I tried. X server problems. But Minecraft is working. Weird.
-
OK, I will leave my menu work (which was pretty much just copied from techtipsta's Minecraft menu) on GitHub and delete the other stuff that does not work. Anyone who wants to try porting Scratch over can use it. Well, as long as techtipsta doesn't mind.
https://github.com/punkbass/ScratchRetroPieSimpleMenu
I may put the shell scripts I made on a different repo since they work fine on Linux (and somewhat on a Raspberry Pi).
But I do not recommend using them on RetroPie at this point since I cannot get them to work myself. I wouldn't recommend trying to install anything that requires an X window. I not going to try anything that uses X windows on RetroPie anymore.
Maybe there's a way to use the libretro API in Squeak (the language Scratch is made from) to make an emulator for Scratch that does not require an X window environment to run. Maybe use RSqueak-VM. https://github.com/HPI-SWA-Lab/RSqueak#rsqueakvm They do have experimental builds for the R Pi.
So the next step would be to see if a RSqueak-VM would work on RetroPie. Then figure out how to run Scratch in it. Then configure controllers. Unless anyone has a better idea.
-
So here's the shell scripts I made converted into Desktop Icons in case anyone is interested: https://github.com/punkbass/Scratch-game-launcher
It works on Raspberry Pi 3 on Raspbian, but it works better on Ubuntu. For some reason QJoyPad did not detect my controller when I tried it on Kano.
-
The read me on the Scratch source code says that Scratch runs on a Squeak virtual machine.
The image for Scratch is in /usr/share/scratch.image
The "scratch" startup script shows how to execute the virtual machine, as well as the necessary command line switches to indicate where additional plugins can be found and which sound plugin should be used.
The plugins are found in /usr/lib/scratch/Plugins
So maybe make a Libretro Plugin for the controls and figure out how to get the Squeak VM with the Scratch image to run from EmulationStation.
Scratch1.4 Source Code:
https://github.com/LLK/Scratch_1.4Other fun stuff to play with that I found:
Scratch joystick blocks (for Chrome)
http://masahirokakishita.github.io/WebMIDI/index_gamepad.htmlScratchVM:
https://github.com/LLK/scratch-vmScratch Server:
http://trac.assembla.com/scratchrVM or Server would probably be too resource intensive though.
-
Sorry it's been a while since I contributed to this discussion. This idea may not work well either. Unfortunately, it only works with Scratch 2 projects and since Scratch updated to Scratch 3, it would only work if you have some old Scratch 2 projects saved or you use the Scratch 2 offline editor.
So you could feasibly make a game from Scratch on Raspberry Pi since it currently has the Scratch 2 offline editor.
However, you would have to transfer those to a Windows machine or you could try running procd using dosbox on Raspberry Pi.
So, the work around is this: compile your Scratch 2 projects into .exe files using Procd which can be downloaded from https://app.box.com/s/cqitt6f10ill2gjus518 then run it on RetroPie using dosbox.
For more information about procd, visit the Scratch project at: https://scratch.mit.edu/projects/35417838/
If you want your Scratch games to appear on a different screen than PC games, you would need to set up configuration files similar to the ones for PC. You may be able to use some of what I already made and posted early for that (although you probably want to make different pictures)
If you have a Scratch 2 editor it would be feasible to remake a Scratch 3 game into a Scratch 2 game by clicking See Inside on the Scratch 3 game and copying all the code inside it. Honestly this would be an interesting project for the kids to do since they would have to write the code themselves to play on RetroPie.
There are issues with procd, it does not render the game exactly like Scratch would. Therefore, it may take some tinkering in the Scratch 2 editor to get it just right, which can be more fun for the kids.
I'm pretty sure Scratch will continue to maintain the offline editor for Scratch 2. The source code is on github and people have made Android versions with it (However the one I used did not have a save feature).
To download Scratch 2 Offline Editor for Mac or Windows, visit: https://scratch.mit.edu/download/scratch2
Source code: https://github.com/LLK/scratch-flashIt should be on Raspbian on Rapberry Pi. ut it should come preinstalled. After they port Scratch 3 to the pi, you can probably still install the Scratch 2 editor by installing the package using the package manager. I do not know what the package name is. Probably just Scratch2. I'm not sure about other distributions of Linux though. I think I was able to run the Scracth 2 Offline editor on Wine on Linux previously though.
Again, this is just speculation so far. I have not tested this out completely yet. I think I'll have to download the Scratch 2 offline editor and completely remake a game to test it.
Oh and you'd have to configure controllers. I have not done that myself yet. Here's the tutorial I've been using for DOSbox: https://digimoot.wordpress.com/2018/08/05/retropie-dosbox-setup-guide/ I've ported some DOS games to my RetroPie. I just haven't configured controllers yet.
There's also another way to convert a Scratch 2 project to an .exe file by converting it into a .swf file and then using Adobe Flash Player archives, which seems more difficult than ProcD, but it might work better for certain projects. You can find it here: https://en.scratch-wiki.info/wiki/Porting_Scratch_Projects
There is a Scratch 3 to Scratch 2 converter: https://github.com/RexScratch/sb3tosb2
So what you could do, is convert the project to Scratch 2. Then use procd to convert it to an .exe. If that doesn't work, you could try converting it to .swf and then using Adobe Flash or editting it with the Scratch 2 editor. Then configure it to work with DOSBOX on RetroPie.I realize this is not ideal, but it's a start anyway.
-
Unfortunately, procd and the .exe files made with it do not work with DOSBOX. The .exe files made with Flash Player do not work wih DOSBOX either. So there goes that idea.
-
I got Scratch 2 offline editor to work on RetroPie using Matchbox. However, there is not a way to close it and go back to Emulation Station. I added it to the RetroPie-Extras at https://github.com/moonpi/RetroPie-Extra with a warning that it will not close. I do not recommend using it because you cannot power your pi down safely. So the next step would be to get it to close correctly. If only they added a quit command in the program. I can't find information about exiting Matchbox either.
-
I decided to move the Scratch 2 port to the unstable RetroPie-Extras at https://github.com/moonpi/RetroPie-Extra-unstable until there is a solution to the not being able to exit problem.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.