Scratch for Java

Examples

Finished projects to play with, read and take apart. Almost all of them run right here in the browser: open one, press ▶, then change something and see what happens. Each page has the whole source code.

Start here

Small projects that use one or two ideas from the tutorials.

Example What it shows
Cat A sprite that walks, bounces off the edges and leaves stamps behind
Glide Sprites sliding to a new place with glide()
Quiz Asking questions with ask() and reacting to the answers
Clock Reading the time of your computer
Volume Turning sounds up and down
Random Dot Drawing with a timer and random positions
Timed Dot Several timers running at different speeds
Rainbow Vine Following the mouse

Games

Whole games, built like the later tutorials: several sprite classes, a score, and sometimes several screens.

Example What it shows
Coin Collector Walking, jumping and collecting, with built-in pictures only
Cat Platformer A platformer with the Scratch for Java cat, enemies and a goal
Donut IO Switching between stages, and many sprites at once
Robot A stage and a sprite class of their own, with hitboxes shown
Sensing Touching the mouse pointer, and hitboxes of your own

Going further

Projects that use more of Java or more of the library: the pen, text, vectors, shaders and Tiled maps.

Example What it shows
Timer Every method of the timer side by side
Pipes Drawing with many pens at once
UI Stretching pictures for panels and bars, and a custom mouse pointer
Shakespeare An evolutionary algorithm that writes a line of Shakespeare
Smart Rocket Rockets that learn to reach a target, with Vector2 and Random
Shader Small graphics programs that change how things are drawn
Stress Test How many sprites can your computer show at once?
Tiled Levels drawn in the Tiled map editor (only on your own computer)
Examples

Create Shareable URL

Select Sections