Coder Social home page Coder Social logo

multipong's Introduction

MultiPong

pong multiplayer based on game-of-everything protocol

##Prerequisite

This game connects to a helper application called "Game of Everything" (see https://github.com/Squarific/Game-Of-Everything). It uses websockets and the JSON format for all messages, and it will quietly ignore any messages it doesn't understand.

##Status

You can choose your nickname, choose host or join, and then connect. (No check is done for duplicate nicknames) When the hosting player presses "fire", the game starts for all players currently joined. The position of all the edges as well as min/max position for the player paddle are communicated to all players. A "ball" (I used a cube in order to have interesting collisions) is launched and bounces off the walls.

Todo

  • test that only the local paddle listens to keyboard input
  • test that paddle positions are correctly broadcast, and interpreted by other players
  • server should restart game when new player joins
  • win/lose conditions

multipong's People

Contributors

bahuman avatar

Watchers

James Cloos avatar  avatar

multipong's Issues

players should accept game start event

this includes:

  • draw the paddles & goals as instructed by the host
  • set the camera to somewhere behind the "own" paddle depending on where the host put you
  • start controlling the "own" paddle & broadcast paddle move events
  • update balls & paddle positions based on updates

Protocol?

World status nodig?

{
  type: "pong-status"
  world: {
    radius: 200,
    sorted-equalsided-manyhook: [
      {"x": 500, "y": 429},
      {"x": 500, "y": 429},
      {"x": 500, "y": 429},
      {"x": 500, "y": 429},
      {"x": 500, "y": 429},
      {"x": 500, "y": 429}
    ]
  },
  ball: {
    size: 10,
    position: {"x": 500, "y": 429},
    speed: {"x": 500, "y": 429}
  },
  playerwidth: 10,
  playerheight: 50,
  players: [{
    id: 'trol',
    position: {"x": 500, "y": 429},
    speed: {"x": 500, "y": 429},
    points: [0, 1]
  }]
}

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.