Giter Club home page Giter Club logo

realtime-multiplayer-space-invaders's Introduction

Realtime multiplayer game of Space Invaders

This project runs a realtime multiplayer version of the classic retro game, Space Invaders.

Preview of the game

Services/ libraries used in the game

You will require an Ably API Key, to run this demo, sign-up for FREE account

How to run this game

  1. Create a free account with Ably Realtime and obtain an API Key
  2. Clone this repo locally
  3. Navigate to the project folder and run npm install to install the dependencies
  4. Rename .env-sample to .env, then edit the file and add your Ably API key and prefered PORT (default 8080).
  5. (Optional) You can update the MIN_PLAYERS_TO_START_GAME to enforce a minimum number of players. (see server-worker.js)
  6. Run the server with node server.js and then open a brower to localhost:8080

Read the full blog post series on dev.to.

Please reach out to me on Twitter for any questions, or follow us @ablyrealtime

realtime-multiplayer-space-invaders's People

Contributors

dependabot[bot] avatar fliptopbox avatar marcduiker avatar owenpearson avatar srushtika avatar thisisjofrank avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

realtime-multiplayer-space-invaders's Issues

Sending too many ably events

I cloned the repository, started the app.. which didnt work, and left my computer. After a couple of hours I started receiving emails that my ably account was blocked because I'd sent over 50k messages. I don't know whats wrong, but thought you should be aware of it.

Add a few seconds buffer time where all players are invincible when the game initially starts

Currently, the game logic is so that the ship starts at a random position and moves with random speed and direction. This means the players don't really have enough time just when the game starts to understand the ship's position and try to escape. It would be worth making all the player invincible for about 2 seconds so they don't die even if a bullet hits them in the first two seconds of gameplay.

Game improvements

TODOS:

  • Host the server on Heroku
  • Move all Math.Random statements to use a single function
  • Game canvas needs to adapt to browser window size
  • Implement rooms functionality to have simultaneous games on
  • Limit room size and restrict users joining after the limit
  • Add animations and sounds
  • Add controls for mobile browsers
  • Move assets out of Glitch CDN
  • Add sound controls
  • Update favicon to make it visible in light mode

Add audio as an optional control which is off by default

It has been raised that, it might be annoying to open a web page that plays audio without a warning. This game does have audio, so we need to add a checkbox control so users can turn it on if they like, but it is off by default.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.