Document stub.png This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines and Scratch Wiki:Editing Conventions. (Aug 2024)
Reason: 90% of this page is a tutorial and should probably be split.

The Demoscene is a subculture of Computer Science where programmers will write a program designed to (typically) show off a point.

Reasons to write a Demo

  • To demonstrate a particular skill.
  • Push boundaries of where the program was written. (Popular in Scratch)
  • To see how small they can write a program.
  • To produce impressive visuals.

Making a simple Demo

To create a demo, start with the most traditional idea, which is impressive visuals (falling under Pen Project).

Pre-Coding setup

Create four sprites: Point1, Point2, Point3 and lastly Renderer. All of them will have one blank costume.

Create a new backdrop and make it black (optional).

Code

Here is the code for all 4 of the sprites.

Point 1, 2, 3, Code

when green flag clicked
point in direction (pick random (180) to (-180))
go to x:(0) y:(0)
forever
 move (10) steps
 if on edge, bounce
end

Now to alter the amount of steps being moved, or the directions.

Renderer Code

when green flag clicked
forever
 Render
 change pen (color v) by (1)
end

Define Render
erase all
set pen size to (10)
pen down
go to (point1 v)
go to (point2 v)
go to (point3 v)

Remember to tick the "Run without screen refresh" block in the Define Render settings.