Skip to content

A half-broken C++ software to play simple Scratch games offline using SDL2.

License

Notifications You must be signed in to change notification settings

giroletm/ScratchPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScratchPlayer

A half-broken C++ software to play simple Scratch games offline using SDL2.

Usage

Download the latest release of the software or compile it yourself.

Then, acquire the .sb3 file of whatever Scratch project you want to play, and drag-and-drop it onto the software's executable.

(Alternatively, you can do this on your favourite terminal, by passing the path of the .sb3 file as the first argument of the command.)

Limitations

  • Blocks from the "data", "procedures" and "argument" category aren't supported
  • Custom blocks aren't supported
  • Backgrounds and sprites that have text won't render it, due to SDL2_image limitations
  • A lot of heavy projects won't run properly or will lag

Compiling

Prerequisites

To compile this software, you'll need:

Step 1 - Compiling libraries

SDL2, SDL2_image and SDL2_ttf are included as compiled binaries in this repo. However, for obvious safety reasons, it is always recommended to compile these by yourself. For this, check the instructions from the corresponding repos.

zlib and libzip need to be compiled by hand, though. For this:

  • Open zlib's solution file (Libs/zlib-win-build/build-VS2022/zlib.sln) with Visual Studio 2022
  • Build the solution with the targets you're interested in (Debug/Release for Win32/x64)
  • Repeat the process with libzip's solution file (Libs/libzip-win-build/build-VS2022/libzip.sln), with the same targets as zlib
  • It is required for you to build zlib first, as libzip relies on zlib to build itself.

Step 2 - Compiling the main program

Once that libraries are compiled, open the solution file located at the root of the repo with Visual Studio 2022 and try to build the solution with the same targets as zlib and libzip.

You should be able to find the output executable at the root of the repo, in folders having names matching your targets.

Add the DLLs from your builds in the same folder and it should run. If you're struggling with that, I've uncluded a DLLs folder containing all of them, sorted by target. Do note that again, it is always recommended to use your own DLLs, as using ones from strangers could compromise your computer.

Notes

This project is widely unfinished!

I've started it a few months ago but eventually lost the motivation to finish it, but I'm publishing it in the hopes of it being useful to someone.

Licensing

Please refer to the LICENSE file.

Credits

libsdl for SDL2, SDL2_image and SDL2_ttf.

nlohmann and his contributors for json library

Mark Adler, Jean-loup Gailly and their contributors for zlib

Dieter Baron, Thomas Klausner and their contributors for libzip

Kelvin Lee for his zlib-win-build and libzip-win-build repositories

About

A half-broken C++ software to play simple Scratch games offline using SDL2.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages