Learn to code with p5.js

Bite-sized, hands-on lessons that teach programming by drawing. No account needed — your progress is saved right here in your browser.

Your progress0 / 32 lessons

1. Getting Started

Meet the canvas, draw your first shapes, add color, print to the console, and make things move.

0/4

2. Variables & Data Types

Store values in variables, do math with numbers, build messages from strings, flip booleans, and use it all to drive a drawing.

0/5

3. Conditionals

Teach your sketch to make decisions: run code only when a condition is true, choose between options, and combine tests.

0/4

4. Loops

Repeat code without repeating yourself — draw rows, space shapes out with a counter, and build grids with loops inside loops.

0/4

5. Functions

Bundle code into your own named functions, feed them inputs, return values, and reuse them to build whole scenes.

0/4

6. Arrays

Store a whole list of values in one variable, read them by index, loop over them, build them up, and use them to draw patterns.

0/4

7. Objects

Bundle related data into objects, read and use their properties, give them methods, and manage a whole crowd with an array of objects.

0/4

8. Capstone Projects

Put it all together — build a bouncing ball, a twinkling starfield, and an interactive art toy using every skill you've learned.

0/3