Getting started

npm run dev - start server with nodemon (port 3000)

Endpoints

  • /login - login endpoint
  • /game - game endpoint
  • /status - status endpoint

How to deploy

git push heroku HEAD:master - push your HEAD to master in heroku's remote

Troubleshoot

heroku logs -a onara-beta -d web -t - watch heroku logs

Stack

Authentication

Bugs

  1. when a player disconnects while moving, socket.close() is not fired. therefore, other players see the disconnected player for a while after the player has left.
  2. Call doesn't work when I call Won. Only works when Won calls me. Look into turn and stun server.

Resources

Firebase

Bootstrap

Crashes

  • TypeError: Cannot read property 'status' of undefined

Route 53 & Heroku

WebRTC

Pusher

Smooth movement in multiplayer game

Phaser Wiki

https://github.com/samme/phaser3-faq/wiki#how-do-i-scaleresize-the-game-canvas

Camera/Audio

  • if you're camera/audio is disabled, you will get streams from users who were already in the room, but will not receive streams from new users

Resize phaser when window size is changed

Flex basis

Add dom elements in phaser

Use container and text to display information

React + Phaser

https://phaser.discourse.group/t/phaser-3-interaction-with-react/308/7

Just adding my 2 cents since I’m also working on a project using both React and Phaser 3.
The way we linked both is quite simple, we simply used EventEmitters.
When something interesting happens in Phaser, we emit an event and our React components are listening to them. We can then use setState since we’re back inside React.
It also perfectly work the other way around when we need to update Phaser based on React events.

https://phaser.io/phaser3/devlog/120

Game Assets

Video Chat tutorials

Phaser tutorials