Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a multiplayer version of space invaders

Building a multiplayer version of space invaders

This PDF version does not include the GIFs, videos, or demos that were part of the talk.

Link to the original presentation: https://bit.ly/36kkqvz

You can reach out https://www.twitter.com/Srushtika to ask any questions or get access to complete resources including a link to the recorded video or full source code.

Srushtika Neelakantam

May 22, 2020
Tweet

More Decks by Srushtika Neelakantam

Other Decks in Programming

Transcript

  1. BUILDING A MULTIPLAYER VERSION OF SPACE INVADERS SRUSHTIKA NEELAKANTAM |

    HALFSTACK CONF ONLINE 2020 | ABLY REALTIME @Srushtika
  2. BUT FIRST, LET’S PLAY THE GAME! - This game demo

    is capped at 10 people (to make sure my system doesn’t crash), so fastest fingers first! - Open the link in a computer browser. For best experience, maximize the window and set the magnification to 100% or less. - This video stream that you are looking at is about 15-30 seconds behind what’s actually happening in the real world. So I’ll join the game myself, the people who aren’t participating can have a look at that. I’ll try to do things slowly and try to stay alive by the time everyone actually joins. So let’s see how this goes. @Srushtika | HalfStack Conf Online 2020 https://go.ably.io/play-space
  3. GameScene extends Phaser.Scene { } WORKING OF PHASER GAME COMPONENTS

    @Srushtika | HalfStack Conf Online 2020 gameConfig = {}
  4. WORKING OF PHASER GAME COMPONENTS @Srushtika | HalfStack Conf Online

    2020 preload() gameConfig = {} GameScene extends Phaser.Scene { }
  5. GameScene extends Phaser.Scene { } WORKING OF PHASER GAME COMPONENTS

    @Srushtika | HalfStack Conf Online 2020 preload() create() gameConfig = {}
  6. GameScene extends Phaser.Scene { } preload() create() gameConfig = {}

    WORKING OF PHASER GAME COMPONENTS @Srushtika | HalfStack Conf Online 2020 update()
  7. NETWORKING GAME COMPONENT @Srushtika | HalfStack Conf Online 2020 Some

    open-source options Socket.io Socket Cluster faye- websocket SockJS Websocketd
  8. @Srushtika | HalfStack Conf Online 2020 GAME ARCHITECTURE GAME COMPONENT

    1. Game Room channel 2. Death notifications channel 3. One channel each for every player that’s playing the game
  9. @Srushtika | HalfStack Conf Online 2020 GAME ARCHITECTURE GAME COMPONENT

    death notifs channel player2 channel player1 channel gameRoom channel player2 player1 server gameRoom channel gameRoom channel . . . player n channel player1 channel player2 channel death notifs channel death notifs channel