2.2: Variables in p5.js (Define Your Own) - p5.js Tutorial

2.2: Variables in p5.js (Define Your Own) - p5.js Tutorial

In this video, I cover how to define, initialize, and use your own variables for the purpose of animating p5.js sketches. Code: https://thecodingtrain.com/tracks/cod... p5.js Web Editor Sketches: ðŸ•đïļ Moving Circle: https://editor.p5js.org/codingtrain/s... ðŸ•đïļ Growing Circle: https://editor.p5js.org/codingtrain/s... ðŸŽĨ Previous video:    â€Ē 2.1: Variables in p5.js (mouseX, mouseY) -...   ðŸŽĨ Next video:    â€Ē 2.3: Incrementation Operators - p5.js Tuto...   ðŸŽĨ All videos:    â€Ē Start learning here!   Videos: 🚂 let vs var:    â€Ē 16.1: let vs var - Topics of JavaScript/ES6   Timestamps: 0:00 Hello! Let's talk more about variables! 0:18 What are we trying to make? 0:52 What are the steps to making a variable? 1:12 Step 1: Declare 3:01 Step 2: Initialize 4:21 Step 3: Use 5:03 Let's add the code! 5:49 Combining declaration and initialization. 6:43 What is a global variable? 7:31 But the circle isn't moving! How can we fix that? 9:19 How can we make it interactive? 9:50 What's next? Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: http://thecodingtrain.com/ ðŸ‘ū Share Your Creation! https://thecodingtrain.com/guides/pas... ðŸšĐ Suggest Topics: https://github.com/CodingTrain/Sugges... ðŸ’Ą GitHub: https://github.com/CodingTrain 💎 Discord:   / discord   💖 Membership: http://youtube.com/thecodingtrain/join 🛒 Store: https://standard.tv/codingtrain 🖋ïļ Twitter:   / thecodingtrain   ðŸ“ļ Instagram:   / the.coding.train   ðŸŽĨ Coding Challenges:    â€Ē Coding Challenges   ðŸŽĨ Intro to Programming:    â€Ē Start learning here!   🔗 p5.js: https://p5js.org 🔗 p5.js Web Editor: https://editor.p5js.org/ 🔗 Processing: https://processing.org 📄 Code of Conduct: https://github.com/CodingTrain/Code-o... This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecod... #basics #variables #p5js #javascript