
Learn the core p5.js functions, including setup and draw, create canvas, draw shapes, apply colors, text and transforms, and handle mouse interactions with a moving circle example.
Explore variables in p5.js, including global, local, and built-in variables, and see how they control shapes, motion, color, and interaction. Learn how global variables persist across frames, how local variables reset within functions, and how built-in values like mouse x and mouse y and window size drive dynamic sketches.
Preload images in p5.js by declaring a global img variable, loading assets/lwa.jpg in preload, then drawing the image at 0,0 on a 400 by 400 canvas in draw.
Define a global song variable and preload an mp3 with loadSound, then set up a 400 by 400 canvas and play the song on mouse press.
Learn how the map function translates mouse x and y positions into rgb values, mapping 0–width and 0–height to 0–255, and draw centered rectangles while handling mouse and keyboard events.
Learn how to create a 2d bouncing ball in p5.js by using setup to configure canvas, draw to animate, and reverse dx or dy on wall hits; ball size 40.
Explore real-time motion and gesture tracking with the handPose model from ml5.js in p5.js, using pre-trained landmarks to drive interactive visuals and music.
Build a simple musical instrument using ml5 handPose and a p5 oscillator by mapping the index finger's x-position to pitch and y-position to volume, with real-time gesture detection.
Explore the face mesh model from the ml5gs library used with p5gs to track 478 facial keypoints, enabling face filters, eye tracking, and emotion-inspired interaction on live video.
Master the BodyPose model using ml5.js and p5.js to detect full-body posture with 17 key points and confidence scores for skeleton connections.
Explore the fundamentals of physical computing and its role in creative coding with p5.js, providing an overview of concepts, tools, and projects in JavaScript.
Interested in creative coding and generative art? Start with p5.js! p5.js is JavaScript programming library which is suitable for beginners to learn programming and scription with fun interactive and animations. This course uses the p5.js library for visual programming and interactive sketches, no prior coding experience required.
Dive into core p5.js functions like setup(), draw(), shapes, colors, animation, and mouse/keyboard interaction to build dynamic canvas projects that respond to user input in real-time.
Perfect for artists, designers, developers new to code, hobbyists, educators, or anyone wanting to prototype ideas visually without complex setups or heavy frameworks.
This hands-on course covers canvas basics, drawing functions (line, circle, rect), color modes, loops for patterns, conditionals for interactivity, object-oriented sketches with classes, sound integration via p5.sound, and export-ready projects for web or portfolios.
Contents:
p5.js environment setup and first sketch
Basic shapes, stroke, fill, and color modes
Animation loops and timing with frameRate()
Mouse and keyboard event handling
Arrays and loops for generative patterns
Classes and objects for complex interactions
Image loading, pixel manipulation, and filters
What are you waiting for? Learn p5.js Creative Coding and transform your ideas into interactive visuals that captivate audiences worldwide. Thanks for joining—let's create something amazing together!