https://github.com/fabiosantoscode/mp
Simple multiplayer deathmatch game written in javascripts
https://github.com/fabiosantoscode/mp
Last synced: 10 months ago
JSON representation
Simple multiplayer deathmatch game written in javascripts
- Host: GitHub
- URL: https://github.com/fabiosantoscode/mp
- Owner: fabiosantoscode
- Created: 2014-12-28T18:16:22.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-06T18:59:03.000Z (over 9 years ago)
- Last Synced: 2025-01-17T22:45:21.475Z (about 1 year ago)
- Language: JavaScript
- Size: 1020 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Game
This is a game inspired on Portal, Super Mario World and Team Fortress, my favorite games :)
Play it on [http://mpg.sl.pt](http://mpg.sl.pt)
# Tech
Using pure canvas all the time, so that I can learn canvas and its limitations.
Browserify is used because there is a ton of shared code between client code and server code.
Node streams are used to sync the client+server world. They also provide some code reusability. For example, when there's no server world (for example [http://mpg.sl.pt:8080/singleplayer.html](here, although the enemy AI is NOT agressive at all)), simply createReadStream() will never be called on the game engine, and the player's keyboard (and onscreen keyboard) events (which are streams) won't be piped to a server socket, they are piped to the local player instead. Implementing a spectator mode was very easy because of streams too, and if I ever decide to implement a save game/replay game function, I just have to pipe a game sync stream with timestamps to/from a file. Yay!
I know unreliable transforms are superior for realtime games, but the web doesn't have an unreliable transport. Other than WebRTC data channels. But I'm lazy and they're under used and under supported so I just used WebSocket.
I am trying out ES6 because I love arrows so I'm using Traceur to transform code.
# Philosophy
I just want to play around with game development and try out new web things and see how it goes!
And I'm enjoying it!
# License
WTFPL