Log In  


Cart #notepool-0 | 2021-12-11 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
7

Here's a little toy that makes sound. Balls bounce around the screen and make different noises when they collide with each other. You can nudge the white ball around with the arrow keys. I tried to add some very minor lighting effects on the balls and to make the sounds respond to the force imparted on each collision.

The code is, of course, a mess.

7


This is really nice to watch and listen to, @luchak. Gold star work.

I might suggest you can choose the # of marbles to bounce around in a main menu and let the player at any point control any one of the marbles to bounce into the others to set them moving.


Thank you, I'm glad you liked it! Adjusting the number of marbles is a great idea.

Right now the sfx are all manually generated so each ball (except the white ball) gets a unique note for its collisions, and a unique chord for its collision with the white ball. Each of these are done at 4 different velocity levels. For more balls it might be better to set that all up programmatically...

I'm also wondering if it might be better to make the simulation very slightly damped, instead of damping/driving it to a single target energy. That would put the user more in control since the sim would slowly run down without user input.


this is nice! That sounds reverb gives a nice "rubbery" feel to the balls. And compliments to the speed-dependent sfx, very cool.


@Hobhob Thank you, I appreciate that! When I get to a good stopping point on my current audio project I was thinking it might be fun to do another simple physics sim where there is an even wider selection of (procedurally-generated?) sfx to play depending on different collision parameters.



[Please log in to post a comment]