GithubHelp home page GithubHelp logo

thebedroomprogrammer / lowkey-multiplayer Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 3.0 17.77 MB

A simple browser based real-time multiplayer game.

JavaScript 90.39% HTML 2.85% CSS 6.76%
nodejs webpack4 javascript websockets multiplayer-game realtime-games canvas-game

lowkey-multiplayer's Introduction

Lowkey-Multiplayer

A simple browser based real-time multiplayer game. (Playable Demo)

Alt text

About the project

This project is the simplest implementation of a Realtime Multiplayer Game that relies on websocket for communication and a Node js backend. No framework has been used in order to keep it as simple as possible. I have used webpack for bundling the files.

The project aims to get a basic understanding of how Realtime Multiplayer Games work online. Code you find here might not be that of a great quality but coding this game from scratch has given me a good understanding of how a game framework works behind the scenes in order to run a game.

As I learn more and more about coding games on web, the code quality would be improved and new features would be added to the game.

Game Mechanics

You click on the start game button and you enter a game area with 100% life. Controls to move are W,A,S,D and space_bar to fire bullets. You can fire 5 bullets at once and it takes 1 second to reload. Each bullet hit takes 20% of your life. As soon as you are dead, the game ends and you are back at the first screen.

How to run the game locally?

There are two folders Server and Client. use npm install in both the folders to install the dependencies.

Go to Server folder and use npm run start to start the server listening at PORT 3000. Go to Client folder and use npm run serve to start the server listening at PORT 8090. The socket.js file inside Client will make a websocket connection to the node server using websocket.

Visit localhost:8090 to see the game up and running.

How to deploy?

Go to Client folder and use npm run build to build a js and and html file in the dist folder. Copy the contents of dist folder and paste it inside the Public folder of Server folder. Make sure before building the project change the link of the websocket in Socket.js file where you are going to connect to the server. Now all you need to do is just host your Server folder as it contains all the necessary files inside the Public folder. Deploy and visit the Index Page of your deployment side to see the game up and running.

To Do's

  • Player stats
  • In game chat
  • Pan camera
  • Username addition
  • Improve performance
  • Game Rooms

lowkey-multiplayer's People

Contributors

thebedroomprogrammer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.