Live data from Hacker News

Show HN: I saw this mind-blowing experiment, so I made a simple version of it

github.com

1–10 of 140 posts

Show HN: I saw this mind-blowing experiment, so I made a simple version of it

#1
Two browser windows (acting as socket clients) communicate their:

- Screen dimensions - (screen.width, screen.height)

- Window dimensions - (window.innerWidth, window.innerHeight)

- Window X/Y position - (window.screenX, window.screenY)

...or whichever calculation works best for you.

The original work by Bjorn Staal https://twitter.com/_nonfigurativ_/status/172732259457002734 used localStorage, but I found sockets more fun, because if tweaked a bit, this can be shared with friends.

Here's a demo of how it works and the codebase: https://github.com/Momciloo/fun-with-sockets/

Show HN: I saw this mind-blowing experiment, so I made a simple version of it
github.com

Re: Show HN: I saw this mind-blowing experiment, so I made a simple version of it

#4
More like this:

- https://twitter.com/steveruizok/status/1727625036159234555

- https://twitter.com/_nonfigurativ_/status/172732259457002734...

- https://twitter.com/wesbos/status/1727755227766350031

- https://twitter.com/wesbos/status/1727722358465523721

Re: Show HN: I saw this mind-blowing experiment, so I made a simple version of it

#10

Wow this seems profound, I didn’t even know you could do that, that could be the future of augmented reality if you think about it, layers! Great job!

Is it really different from any multiplayer game? Two view ports, shared coordinates, independent renderers. The “trick” is that the view ports are overlapping, but I would imagine sendMessage might be faster and not require any server round trip.
Post reply on HN