Giter Site home page Giter Site logo

psykhi / pong Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 103 KB

A simple version of the game of pong, entirely written in Go and running in the browser

Home Page: https://pong-wasm.web.app/

Makefile 0.34% Go 59.60% HTML 1.93% JavaScript 37.29% Dockerfile 0.56% Shell 0.28%
golang go game webassembly server

pong's Introduction

An online, multiplayer version of the game of pong, entirely written in Go and compiled to webassembly.

Running live at https://pong-wasm.web.app/. You can open another tab if no one wants to play with you ;(

Getting started

  • Compile the frontend code: make
  • Start a fileserver to serve that code: cd fileserver && go run server.go
  • Start the game server : cd server/cmd && go run main.go
  • Connect to localhost:3000

Architecture

Client and server run the game engine, running at 128 ticks. Client sends its keyboard/touch input at a fixed frequency to the server, and both predict the next state of the game. When the client receives a server update, it reconciles both predictions by "replaying" the events that have happened since the last server packet was received.

pong's People

Stargazers

Gräviti avatar

Watchers

James Cloos avatar Alexandre Pesant avatar

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.