Scratch2Godot is a converter that transforms Scratch projects (.sb3) into Godot projects.
An example Scratch game and its converted Godot version can be found in the temp folder.
Important Note: This tool is still in development and not fully functional. Some features are experimental or not yet implemented.
Implemented:
- Detection and import of all sprites and stage backgrounds
- Full support for motion blocks (from both Scratch and PenguinMod)
- Support for all standard Scratch "Looks" blocks
- Partial support for PenguinMod "Looks" extensions
- Standard speech bubbles are supported; special effects like stylized bubbles are not yet implemented
- Visual effects exist but may not work exactly as in Scratch
- Full support for all operator blocks
- Partial implementation of control blocks:
wait (1) secondswait (1) seconds or until <>repeat (10)foreverif <> then {}if <> then {} else {}repeat until <> {}while <> {}
- Limited support for event blocks:
when green flag clickedwhen this sprite clickedwhen (key) pressed- (not yet tested)
when backdrop switches to () when I receive []boradcast ()boradcast () and wait
In Development / Planned:
- Full support for event handling (except for
when [loudness] > ()), currently under development and not yet stable. - Complete support for additional block categories (e.g. sensing, variables)
- Improved error handling, debugging output, and overall conversion stability
- Operating System: Windows, macOS, Linux
- Python Version: 3.x (recommended: 3.8 or higher)
- Godot Version: 4.x (recommended 4.3)
- Required Dependencies: OpenCV (
cv2), NumPy, Pillow, etc.
If not already installed:
- Windows: Download Python and install it (make sure to check "Add Python to PATH").
- Linux/macOS: Python is usually preinstalled. If not:
# Ubuntu/Debian
sudo apt install python3 python3-pip
# Arch
sudo pacman -S python python-pip
# macOS (with Homebrew)
brew install python3 - Install Git (to clone the repository):
# Windows: Download and install Git from https://git-scm.com/downloads
# Ubuntu/Debian
sudo apt install git
# Arch
sudo pacman -S git
# macOS (Homebrew)
brew install git Open a terminal and run:
git clone https://github.com/br0tcraft/Scratch2Godot.git
cd Scratch2Godot- Create a virtual environment (optional but recommended):
# macOS/Linux
python -m venv venv
source venv/bin/activate
# Windows
venv\Scripts\activate - Install dependencies:
pip install -r requirements.txt OpenCV (cv2) may not be the most optimal choice for this project, but it was chosen for its ease of integration. Future updates might explore other options.
If cv2 doesn't work directly, install it manually:
pip install opencv-pythonIf there are issues on Linux/macOS:
# Ubuntu/Debian
sudo apt install python3-opencv
# macOS (Homebrew)
brew install opencv To start the tool and convert a Scratch project to a Godot project, follow these steps:
-
Make sure your Scratch project file (with the extension
.sb3) is accessible. -
Rename it to
ScratchProject.sb3and place it inside thetempfolder. -
Your folder structure should look like this:
Scratch2Godot/ ├── main.py ├── temp/ │ └── ScratchProject.sb3 ├── utils/ └── resources/ -
Alternatively, you can specify the path to any SB3 file directly.
-
The resulting Godot project will be stored in the
tempfolder. -
You can open the generated project in Godot by navigating to the
tempfolder and selecting the main project file (project.godot).
- You can adjust the project settings by modifying the
settingsdictionary insidemain.py:
settings = {
"project_name": "Scratchgame",
"project_version": "1.0",
"project_author": "Scratch",
"project_description": "A Scratch project",
"fps": "30"
}
- These settings will be applied during the conversion process.