Coding Challenge #62.1: Plinko with Matter.js Part 1
I love all things random and chance so why not make a Plink simulation with the matter.js physics engine and p5.js! Code: https://thecodingtrain.com/challenges/62-plinko-with-matterjs
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/wAe_oPVHo
Other Parts of this Challenge:
πΊ Plinko with Matter.js Part 2: https://youtu.be/6s4MJcUyaUE
πΊ Plinko with Matter.js Part 3: https://youtu.be/jN-sW-SxNzk
πΊ Plinko with Matter.js Part 4: https://youtu.be/CdBXmsrkaPs
π₯ Previous video: https://youtu.be/0dwJ-bkJwDI?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/JunJzIe0hEo?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π Matter.js: http://brm.io/matter-js/
π° What is Plinko?: http://priceisright.wikia.com/wiki/Plinko
Videos:
π Introduction to Matter.js: https://www.youtube.com/watch?v=urR596FsU68
π Inheritance with Prototype in JavaScript: https://www.youtube.com/watch?v=CpmE5twq1h0
π΄ Live Stream #84: https://youtu.be/Iu3M-X1yRFU
Related Coding Challenges:
π #20 3D Cloth with Toxiclibs: https://youtu.be/jrk_lOg_pVA
π #98 Quadtree: https://youtu.be/OJxEcs0w_kE
π #160 Spring Forces: https://youtu.be/Rr-5HiXquhw
Timestamps:
0:00 Introducing today's topic: a Plinko Simulation
1:25 How does Plinko work?
3:32 Create a Particle object
4:28 Matter.js library
6:02 Use Matter.js to create a Body
7:35 Use Prototype to show the particle
10:38 Use Engine.update() to update the particle position
15:10 Add a Plinko object
21:47 Add bounce by adjusting restitution and friction
24:16 Shift every other row of the Plinkos
25:31 Conclusion and next steps
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
#collisiondetection #matterjs #physicsengine2d #plinko #javascript #p5js #matterjs