logoalt Hacker News

Show HN: Boing

427 pointsby gregsadetskytoday at 3:46 AM82 commentsview on HN

Comments

junontoday at 5:02 AM

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);
show 6 replies
coffeecoderstoday at 7:32 AM

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.

show 3 replies
mythztoday at 10:10 AM

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.

dfextoday at 6:13 AM

Finally!

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

show 1 reply
reactordevtoday at 10:43 AM

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.

TheAceOfHeartstoday at 6:00 AM

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.

show 3 replies
jonplacketttoday at 9:03 AM

Oh it needs a total boings by everyone counter!

show 2 replies
codeuliketoday at 10:08 AM

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.

show 1 reply
alex440440today at 12:10 PM

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.

texuftoday at 8:39 AM

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.

show 1 reply
egerestoday at 9:52 AM

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

cr125ridertoday at 5:03 AM

Oh random Flash apps, how I miss you

show 1 reply
ethmarkstoday at 4:41 AM

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?

show 1 reply
aetherspawntoday at 7:19 AM

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.

show 1 reply
prodigycorptoday at 4:30 AM

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.

modelesstoday at 5:09 AM

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

cons0letoday at 6:46 AM

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

satvikpendemtoday at 4:14 AM

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.

OuterValetoday at 7:19 AM

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

naichtoday at 10:21 AM

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

gnarlousetoday at 6:50 AM

Is this physics based audio?

show 1 reply
____tom____today at 5:26 AM

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.

show 2 replies
qwertytyyuutoday at 5:30 AM

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

sam-cop-vimestoday at 6:26 AM

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 :-)

show 1 reply
Quizzical4230today at 6:13 AM

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

abhinavsnstoday at 6:20 AM

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

show 1 reply
nopurposetoday at 8:31 AM

How many before you stopped? I am at 37.

show 2 replies
ramnik10today at 7:20 AM

I liked it, would love to code it

brcmthrowawaytoday at 9:12 AM

AI?

show 1 reply
rezmasontoday at 6:15 AM

There goes my evening.

bitcrshrtoday at 5:34 AM

I needed this. Thank you.

jesse__today at 6:22 AM

boingboingboing

29athrowawaytoday at 6:14 AM

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

johnwheelertoday at 5:58 AM

Most excellent.

akhotoday at 8:43 AM

when haptics

show 1 reply
thenthenthentoday at 6:10 AM

Can we add accelerometer support? :D

karanveertoday at 5:23 AM

so satisfying.

cataparttoday at 4:52 AM

fantasitic

doppelgunnertoday at 8:07 AM

[dead]

supareyatoday at 5:06 AM

Hi