Show HN: Boing

boing.greg.technology

744 points by gregsadetsky 2 days ago


junon - 2 days ago

Love this. Had to cheat, naturally.

    setInterval(()=>{const canvas=document.getElementById('canvas');const startX=266;const startY=198;const rect=canvas.getBoundingClientRect();const startClientX=rect.left+startX;const startClientY=rect.top+startY;let endClientX,endClientY,distance;do{endClientX=Math.random()*window.innerWidth;endClientY=Math.random()*window.innerHeight;const dx=endClientX-startClientX;const dy=endClientY-startClientY;distance=Math.sqrt(dx*dx+dy*dy)}while(distance<25);const dispatchMouseEvent=(type,target,clientX,clientY)=>{const event=new MouseEvent(type,{view:window,bubbles:true,cancelable:true,clientX:clientX,clientY:clientY,screenX:clientX+window.screenX,screenY:clientY+window.screenY,buttons:type==='mouseup'?0:1,button:0});target.dispatchEvent(event)};dispatchMouseEvent('mousedown',canvas,startClientX,startClientY);setTimeout(()=>{dispatchMouseEvent('mousemove',window,endClientX,endClientY);setTimeout(()=>{dispatchMouseEvent('mouseup',window,endClientX,endClientY)},1);},1);},1);
coffeecoders - 2 days ago

Funny thing: this feels "realistic" because it’s not perfect physics. A perfectly simulated Hooke's law spring actually looks fake and too stiff. But if you let the animation wobble a bit more and slow down the damping, our brain reads it as weight and squishiness.

It’s basically controlled sloppiness.

mythz - a day ago

This takes me back a few years when the first of my Uni friends had a baby, they spoiled him with so many toys that their lounge room was like an obstacle field where you had to be careful where to step, but despite all his toys the baby spent all his time while I was there playing with the door spring.

There's something therapeutic about door springs, that you just have to stop and play with it.

analogears - a day ago

This reminds me why simple single-purpose web toys used to be so satisfying. No account, no onboarding, no "upgrade to pro" - just a thing that does one thing well. The world counter is a nice touch without being gamified into oblivion..

dfex - 2 days ago

Finally!

Time to recreate the classic: https://www.youtube.com/shorts/pTgJaJYHIAs

gnarlouse - a day ago

@gregasadetsky: you should make it social… you know, like, just because. Like I want to be able to send my sister my latest “Boing,” and see what she thinks of my technique.

alex440440 - a day ago

If you were Elon you would claim it's an early alpha of a world simulator that in a year will be able to perfectly predict weather and stock market.

TheAceOfHearts - 2 days ago

Any consideration on sharing the unminified code? I was a bit curious to read through the code and it seems like such a shame to keep it obfuscated. From a quick perusal, it seems like the bulk of the code comes from howler.js (a sound library), and the core functionality is conveniently implemented below the mobile template.

modeless - 2 days ago

I would love to see an accurately simulated version of this, à la https://www.engine-sim.parts/

jonplackett - a day ago

Oh it needs a total boings by everyone counter!

reactordev - a day ago

That’s got to be one of the most satisfying things ever. The real device was a darling invention and this is a faithful recreation of the experience of being in time out in the 80s.

codeulike - a day ago

It doesnt boing rotationally, only in a straight line. Like the spring isn't really there.

If I bend it right round to one side so the spring is curved I expect it to bounce round to the other side.

aetherspawn - 2 days ago

The sound is not physics based, the boing sound keeps going if you grab the head, likewise sometimes the sound ends before the vibration finishes.

cons0le - 2 days ago

Finally something I actually want to pay for!! Give us a premium tier with exclusive boingers plz

ethmarks - 2 days ago

I noticed that the boing sound gets deeper and lower with smaller-magnitude boings. Is the boing audio generated procedurally/realistically in response to the physics of the boing, or is just playing a premade boing sound effect that's dynamically pitch shifted?

cr125rider - 2 days ago

Oh random Flash apps, how I miss you

prodigycorp - 2 days ago

i love this. it reminds me of simpler times when we’d have iphone apps/games that would explore a single mechanic and implement it really well.

gnarlouse - 2 days ago

Is this physics based audio?

texuf - a day ago

TIL I don't know how to “unmute” my device anymore. My new-ish iPhone doesn't have a physical switch on the side and I can’t find it in the settings in the pulldown menu.

satvikpendem - 2 days ago

Very fun and nostalgic. The head of the boinger doesn't seem to exactly follow the cursor/finger however, at least on mobile, it always arcs.

mrlonglong - a day ago

Going to give this to a cat to play with, see if he enjoys it

e1gen-v - a day ago

If you manage to push it all the way down directly in the middle it boings forever

egeres - a day ago

Amazing to see software like this without sign-in requirements or paid subscriptions!

ianberdin - a day ago

Challenge accepted: https://boing.playcode.io.

three.js, audio generating.

____tom____ - 2 days ago

There seems to be a minor bug. When I switch tabs and come back, sometimes the spring is moving. Some times a small amount, and other times it appears to be streched to the max, and extending off the top and bottom of the screen, until it calms down.

Safari, Mac.

qwertytyyuu - 2 days ago

As a phone user, I hate you, I hate how good this is. That counter is just mocking me.

uriee - a day ago

Man, slow MO + plot the vibration freq on the axis.

OuterVale - 2 days ago

This is the natural thing to make with this tool: https://youtube.com/watch?v=5VGLPP70Xtw

foobarbecue - a day ago

It's broken! Now when I boing it, it goes totally wild instead of behaving as expected. Did somebody hack it?

sam-cop-vimes - 2 days ago

I wasn't hearing the sound initially so I thought it wasn't working in Firefox. Put the sound all the way up and boinged again. Made me jump out of my seat. Hilarious :-)

naich - a day ago

I had to stop at 100 or I would have been there all day.

Quizzical4230 - 2 days ago

Love this! It's highly addictive. (No guilt)

tdeck - a day ago

I'm slightly ashamed of how many times I boinged this. Great work!

abhinavsns - 2 days ago

There seems to be a bug. If I catch it mid boing, the sound doesn't stop.

nopurpose - a day ago

How many before you stopped? I am at 37.

ramnik10 - 2 days ago

I liked it, would love to code it

bitcrshr - 2 days ago

I needed this. Thank you.

rezmason - 2 days ago

There goes my evening.

Ylpertnodi - a day ago

Could you include a dark mode? Great fun.

thenthenthen - 2 days ago

Can we add accelerometer support? :D

jesse__ - 2 days ago

boingboingboing

akho - a day ago

when haptics

brcmthrowaway - a day ago

AI?

29athrowaway - 2 days ago

I noticed that the sound changes depending on how you interact with it. Neat

johnwheeler - 2 days ago

Most excellent.

fHr - a day ago

absolute peak, love it

karanveer - 2 days ago

so satisfying.

- 2 days ago
[deleted]
xpe - a day ago

Anyone want to commission an AI to make a sequel called Boing or Krill where you have to choose between boinging the spring or playing a game of snake (drawn as a line of krill)?

catapart - 2 days ago

fantasitic

doppelgunner - a day ago

[dead]

supareya - 2 days ago

[dead]