Uploaded May 2021 | Updated November 2026, 2 days ago
In this video, I introduce the concept of variables! The setup() and draw() functions are covered along with mouseX and mouseY in p5.js. Code: thecodingtrain.com/tracks/code-programming-with-p5-js/code/2-variables/1-mouseX-mouseY
πΉοΈ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/sketches/IeblvUQrf
π₯ Previous video: youtu.be/xJcrPJuem5Q?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ Next video: youtu.be/dRhXIIFp-ys?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
References:
πΎ mouseX: p5js.org/reference/#/p5/mouseX
Timestamps:
0:00 Introduction
0:35 What is program flow? How does it work in p5.js?
2:22 Let's simplify!
3:16 What is a variable?
4:47 What's happening here?
5:26 What could we do? Let's make a simple painting program!
6:05 Let's move background into setup. What do you think is gonna happen?
6:34 Why does that happen?
7:31 Let's talk about events! We can add a mousePressed function.
8:41 Let's add mousePressed and put background in it!
9:07 You might have this question. Why isn't it flickering?
10:10 What can you try? Can't wait to see what you create!
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
#mouseinteraction #basics #variables #p5js #javascript
In this video, I introduce the concept of variables! The setup() and draw() functions are covered along with mouseX and mouseY in p5.js. Code: thecodingtrain.com/tracks/code-programming-with-p5-js/code/2-variables/1-mouseX-mouseY
πΉοΈ p5.js Web Editor Sketch: editor.p5js.org/codingtrain/sketches/IeblvUQrf
π₯ Previous video: youtu.be/xJcrPJuem5Q?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ Next video: youtu.be/dRhXIIFp-ys?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π₯ All videos: youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
References:
πΎ mouseX: p5js.org/reference/#/p5/mouseX
Timestamps:
0:00 Introduction
0:35 What is program flow? How does it work in p5.js?
2:22 Let's simplify!
3:16 What is a variable?
4:47 What's happening here?
5:26 What could we do? Let's make a simple painting program!
6:05 Let's move background into setup. What do you think is gonna happen?
6:34 Why does that happen?
7:31 Let's talk about events! We can add a mousePressed function.
8:41 Let's add mousePressed and put background in it!
9:07 You might have this question. Why isn't it flickering?
10:10 What can you try? Can't wait to see what you create!
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
#mouseinteraction #basics #variables #p5js #javascript
![Coding Train Live: Riding the Oregon Trail 2
π‘Sign up for the CuriosityStream + Nebula bundle with a 26% exclusive discount ($14.79 for a full year!) at https://curiositystream.com/choochoo. To access my Nebula class, upgrade for $1 per month or $10 for year!
Launching my next project, a p5.js port of the original Apple ][ Oregon Trail game!
π» https://github.com/CodingTrain/Oregon-Trail
Timestamps:
0:00 Waiting to start
6:28 Welcome to a pop-up episode of the Coding Train Live!
18:37 Curiosity Stream
21:39 Discord Help forum
52:44 Start working on Oregon Trail sketch
1:01:30 Create a game.json file to store the meta data for the game
1:40:28 Rob & Akiva podcast
1:42:10 Add issues to GitHub repo
1:46:05 Invite link to Coding Train Discord
1:48:00 Nebula
2:00:00 Bye everyone
Links:
π Rob & Akiva podcast https://www.podcastone.com/episode/Rob Akiva-Need-a-Podcast-The-Oregon-Trail
π 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
#p5js #oregontrail #game Coding Train Live: Riding the Oregon Trail 2](https://i.ytimg.com/vi/7quQVO_K6Gg/mqdefault.jpg)









