Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ably-labs/realtime-multiplayer-space-invaders
Realtime Multiplayer Space Invaders Game with Phaser 3 and Ably
https://github.com/ably-labs/realtime-multiplayer-space-invaders
ably demo game javascript phaser3 realtime
Last synced: 2 months ago
JSON representation
Realtime Multiplayer Space Invaders Game with Phaser 3 and Ably
- Host: GitHub
- URL: https://github.com/ably-labs/realtime-multiplayer-space-invaders
- Owner: ably-labs
- License: apache-2.0
- Created: 2020-05-21T22:43:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-12T05:38:20.000Z (over 1 year ago)
- Last Synced: 2024-04-17T15:32:37.044Z (9 months ago)
- Topics: ably, demo, game, javascript, phaser3, realtime
- Language: JavaScript
- Homepage: https://space-invaders.ably.dev
- Size: 289 KB
- Stars: 69
- Watchers: 11
- Forks: 32
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
![](./public/space-invaders-hero.svg)
# Realtime multiplayer game of Space Invaders
This project runs a realtime multiplayer version of the classic retro game, Space Invaders.
![Preview of the game](https://user-images.githubusercontent.com/5900152/84092843-7ea1ce80-a9f0-11ea-809d-41cd20fb8e59.gif)
## Services/ libraries used in the game
- [Phaser 3](https://phaser.io)
- [p2 NPM library](https://www.npmjs.com/package/p2)
- [Ably Realtime](https://www.ably.com)You will require an Ably API Key, to run this demo, [sign-up for FREE account](https://ably.com/sign-up)
# How to run this game
1. Create a free account with [Ably Realtime](https://www.ably.com) and obtain an API Key
1. Clone this repo locally
1. Navigate to the project folder and run `npm install` to install the dependencies
1. Rename `.env-sample` to `.env`, then edit the file and add your Ably API key and prefered PORT (default 8080).
1. (Optional) You can update the `MIN_PLAYERS_TO_START_GAME` to enforce a minimum number of players. (see `server-worker.js`)
1. Run the server with `node server.js` and then open a brower to [localhost:8080](http://localhost:8080)Read the full blog post series on [dev.to](https://dev.to/ably/building-a-realtime-multiplayer-browser-game-in-less-than-a-day-part-1-4-14pm).
Please [reach out to me on Twitter](https://www.twitter.com/Srushtika) for any questions,
or follow us [@ablyrealtime](https://twitter.com/ablyrealtime)