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

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=dRhXIIFp-ys



Category:
Tutorial
Duration: 10:43
64,141 views
1,227


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/code-programming-with-p5-js/code/2-variables/2-define-variables

p5.js Web Editor Sketches:
๐Ÿ•น๏ธ Moving Circle: https://editor.p5js.org/codingtrain/sketches/xPXNdPy17
๐Ÿ•น๏ธ Growing Circle: https://editor.p5js.org/codingtrain/sketches/ehbMJ-otC

๐ŸŽฅ Previous video: https://youtu.be/7A5tKW9HGoM?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
๐ŸŽฅ Next video: https://youtu.be/T26OJGjI8qI?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
๐ŸŽฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

Videos:
๐Ÿš‚ let vs var: https://youtu.be/q8SHaDQdul0

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/passenger-showcase-guide
๐Ÿšฉ Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
๐Ÿ’ก GitHub: https://github.com/CodingTrain
๐Ÿ’ฌ Discord: https://discord.gg/hPuGy2g
๐Ÿ’– Membership: http://youtube.com/thecodingtrain/join
๐Ÿ›’ Store: https://standard.tv/codingtrain
๐Ÿ–‹๏ธ Twitter: https://twitter.com/thecodingtrain
๐Ÿ“ธ Instagram: https://www.instagram.com/the.coding.train/

๐ŸŽฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ŸŽฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA

๐Ÿ”— 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-of-Conduct

This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new

#basics #variables #p5js #javascript