Uploaded May 2021 | Updated September 2026, 1 week ago
In this video, I cover how to define, initialize, and use your own variables for the purpose of animating p5.js sketches. Code: thecodingtrain.com/tracks/code-programming-with-p5-js/code/2-variables/2-define-variables
p5.js Web Editor Sketches:
πΉοΈ Moving Circle: editor.p5js.org/codingtrain/sketches/xPXNdPy17
πΉοΈ Growing Circle: editor.p5js.org/codingtrain/sketches/ehbMJ-otC
π₯ Previous video: youtu.be/7A5tKW9HGoM?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ Next video: youtu.be/T26OJGjI8qI?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
Videos:
π let vs var: 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: thecodingtrain.com
πΎ Share Your Creation! thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: github.com/CodingTrain/Suggestion-Box
π‘ GitHub: github.com/CodingTrain
π¬ Discord: discord.gg/hPuGy2g
π Membership: youtube.com/thecodingtrain/join
π Store: standard.tv/codingtrain
ποΈ Twitter: twitter.com/thecodingtrain
πΈ Instagram: instagram.com/the.coding.train
π₯ Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: p5js.org
π p5.js Web Editor: editor.p5js.org
π Processing: processing.org
π Code of Conduct: github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecodingtrain.com/issues/new
#basics #variables #p5js #javascript
In this video, I cover how to define, initialize, and use your own variables for the purpose of animating p5.js sketches. Code: thecodingtrain.com/tracks/code-programming-with-p5-js/code/2-variables/2-define-variables
p5.js Web Editor Sketches:
πΉοΈ Moving Circle: editor.p5js.org/codingtrain/sketches/xPXNdPy17
πΉοΈ Growing Circle: editor.p5js.org/codingtrain/sketches/ehbMJ-otC
π₯ Previous video: youtu.be/7A5tKW9HGoM?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ Next video: youtu.be/T26OJGjI8qI?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
Videos:
π let vs var: 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: thecodingtrain.com
πΎ Share Your Creation! thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: github.com/CodingTrain/Suggestion-Box
π‘ GitHub: github.com/CodingTrain
π¬ Discord: discord.gg/hPuGy2g
π Membership: youtube.com/thecodingtrain/join
π Store: standard.tv/codingtrain
ποΈ Twitter: twitter.com/thecodingtrain
πΈ Instagram: instagram.com/the.coding.train
π₯ Coding Challenges: youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: p5js.org
π p5.js Web Editor: editor.p5js.org
π Processing: processing.org
π Code of Conduct: github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: github.com/CodingTrain/thecodingtrain.com/issues/new
#basics #variables #p5js #javascript



![Playing YOUR Versions of the Apple ][ Snake Game! - Showcase 1 #creativecoding #programming #shorts
For the first episode of this series, I react to a few submissions from the AppleSoft BASIC Snake Game Passenger Showcase. Next stop: Wave Function Collapse Showcase arriving next week!
π₯ BASIC Snake Game: https://youtu.be/7r83N3c2kPw
π¨ https://thecodingtrain.com/challenges/173-snake-applesoft-basic
π₯ WFC: https://youtu.be/rI_y2GAlQFM
π¨ https://thecodingtrain.com/challenges/171-wave-function-collapse
To learn how to submit yours, visit The Coding Train website and follow the guide: https://thecodingtrain.com/guides/passenger-showcase-guide
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/Guides/community-contribution-guide.html
π© Suggest Topics: https://github.com/CodingTrain/Rainbow-Topics
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://discord.gg/hPuGy2g
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
π Books: https://www.amazon.com/shop/thecodingtrain
ποΈ 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 Playing YOUR Versions of the Apple ][ Snake Game! - Showcase 1 #creativecoding #programming #shorts](https://i.ytimg.com/vi/fAyGmUeNIFQ/mqdefault.jpg)






