Coding Challenge #62.4: Plinko with Matter.js Part 4

Part 4 of the Plinko Coding Challenge! In this final video, I add sound to the simulation, a bell ring each time a particle hits a peg.

Link to Part 1:
Link to Part 2:
Link to Part 3:

Support this channel on Patreon:

Send me your questions and coding challenges!:

The Coding Train website:

Links discussed in this video:
What is Plinko?:

Source Code for the all Video Lessons:


For My Videos on Physics Engines:
For More Coding Challenges:
For an Intro to Programming using p5.js:

Help us caption & translate this video!






26 responses to “Coding Challenge #62.4: Plinko with Matter.js Part 4”

  1. Thurston Jhon Muyot Avatar

    Aside from the sound can i possibly play animation on the plinko that the particle hit?

  2. Ee Venn Soh Avatar

    Part 5: Don't know, maybe a scoring system?

  3. Berries gone Smoothie Avatar

    I recreated a mini-game from an old pc game I played as a kid. It kind of works like plinko, with a touch of pinball aswell. Used this tutorial-serie as a base 馃榾 Feel free to try it here

  4. qgmlwy Avatar

    bing bing bing bing bing Flashbacks to Breaking Bad

  5. MrPopsyprebs Avatar

    1 – Is there a reason you麓re not using Brackets, and if so, why? (I might have missed the explanation in a video)

    2 – I see you write parts of the code without spacing, but it (automatically?) then expands and adds the spacing. E.g.: "x<2" becomes "x < 2". Is that a shortcut?

  6. Asep Saepuloh Avatar

    Bro that is beautiful, you are so smart

  7. UniKitty Avatar

    I is from future, you will all bow before my cuteness

  8. NanoCake Avatar

    imagine a guy kidnapped and was imprisoned inside a studio and the only way to regain his freedom is to code more and more

  9. Tim Fargloom Avatar

    Great video. Thank you!

  10. Mr Ed Draws Avatar

    LOL Losing your mind with bell sound.

  11. Vel0city Avatar

    You should have the volume of the sound depend on the velocity of the balls colliding. (higher velocity -> louder sound)

  12. SigmaSixSoftware Avatar

    for the dining you could have called upon the on collision function which returns a boolean which would be easier and cleaner.

  13. TheRandomSpectator Avatar

    One of my favorite parts about this channel is your off topic rants like at the beginning of this video! Never take yourself too seriously!

  14. DJ Charizard Avatar

    All of that just to play a sound when a hit is detected. Man I love computer science.

  15. Retnuh1974 Avatar

    Dude, you are AWESOME for these videos!!!

  16. _Glock Avatar

    Idea for a challenge: Code the Matrix – the green continuously changing, continuously falling text, that would look cool, if you didn't already code it in a previous video.

  17. Travis G Avatar

    Every time you hear a ding, an Angel gets its wings.

  18. Inside the Matrix Avatar

    Can someone tell me what folder i need to put matter.js in to run it in processing. I have p5.js in processing and added the line in the html file but don't know what folder to put it in. I've tried almost all the folders and can't get it to work

  19. Adrian Zar臋ba Avatar

    So actually we can use files from user computer with javascript ?

  20. Luis G贸is Avatar

    Coding Challenge:
    Make a program that converts numbers into Roman Numbers and Roman Numbers into numbers

  21. someuser17 Avatar

    Couple of suggestions that are easy to implement:
    – The particles could fall randomly in a funnel and then be forced to hit the first peg, which should randomize the input.
    – You could leave the event as they are, just change the mp3 to something very short and not annoying and it should be great.

  22. amir b101 Avatar

    hi i am 9th comment. BTW why is this video listed

  23. OrOrg Avatar

    I just went to the past. I am… a time-traveler.
    <Insert spooky music>

  24. MrBloodyshadow Avatar

    The pegs could be filled with a color for each row (like a xylophone) and play a note based on that color/row to play with people's synesthesia.

  25. generaldave Avatar

    The only thing that can hit a "plinko" is a "particle" so in any collision if labelA or labelB == "plinko" then play sound?

    Either way, aside from that horrible dinging, I enjoyed following along with Plinko, as well as most of your videos.

  26. GamingButNotReally Avatar

    FIRST! lol nice video as always Dan!

Leave a Reply

Your email address will not be published. Required fields are marked *