https://github.com/chunqiuyiyu/multi-window-pong-game
Play pong game across multiple windows on the same origin using localStorage
https://github.com/chunqiuyiyu/multi-window-pong-game
game pong pong-game
Last synced: about 1 month ago
JSON representation
Play pong game across multiple windows on the same origin using localStorage
- Host: GitHub
- URL: https://github.com/chunqiuyiyu/multi-window-pong-game
- Owner: chunqiuyiyu
- License: mit
- Created: 2023-11-29T12:45:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-30T15:05:03.000Z (almost 2 years ago)
- Last Synced: 2025-08-17T12:32:58.281Z (about 2 months ago)
- Topics: game, pong, pong-game
- Language: JavaScript
- Homepage: https://chunqiuyiyu.github.io/multi-window-pong-game/index.html
- Size: 7.54 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Multi-window-pong-game
Play pong game across multiple windows on the same origin using localStorage. Inspired by [this](https://github.com/bgstaal/multipleWindow3dScene) project. I hope you enjoy it!## Demo
## How to run
1. Clone the repo
2. open `index.html` in multiple windows tabs## How it works
* Using `localStorage` to store the game state and sync it across multiple windows.
* `screenX` and `screenY` are used to calculate different window positions.
* Maybe [window.getScreenDetails()](https://developer.mozilla.org/en-US/docs/Web/API/Window/getScreenDetails) can be used to get the window position in the future.## License
[MIT](./LICENSE)