yasserfds / viter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

viter.io docs

viter.io is an abandonned .io game, created by Alez and Garklein. We have decided to make all the code public, because we think that others might find it interesting (there aren't many public code .io games).
viter.io is made with:

  • node.js
  • Game.IO
  • Express
  • msgpack-lite
    and various other minor libraries.

how to run

make sure you have the latest version of node.js installed first (see link above)

  1. clone the repository
  2. cd to the folder root
  3. cd server
  4. run node app
  5. the game is now running on http://localhost:80
  6. this brings you to index2.html
  7. to try the game, go to http://localhost:80/play

files

server

These are all the files for the server.

server/app.js Server hosting and packet handling.

server/gameio.js More specific connection handling, and handling of all arrays (this is from the game.io library).

server/node_modules Automatically generated node modules from node.js.

server/server

The meat of the server logic.

server/server/bullet.js Bullet logic.

server/server/commandHandler.js Logic for dev commands.

server/server/gameManager.js Spawning objects and setting up the world.

server/server/object.js Trees, rocks, and crates.

server/server/player.js Shooting, movement, and everything to do with players. Also arrays of all turrets and bodies.

server/server/wall.js Walls.

client

These are all the files for the server.

client/index.html The game HTML page.

client/index2.html The placeholder HTML page, for when it was only in private testing.

client/changelog.html The changelog HTML page.

client/main.css The index.html css file.

client/msgpack.js Used for encoding ws messages.

client/images

All game images. I won't be going in depth since the folders are self explanatory.

client/js

All client JavaScript files. They are all combined into one file on the server.

client/js/client.js JavaScript file written by us. gameio.js setup, and main loop. Handles Also handles one random packet type (setID), for some reason.

client/js/gameio.js File initially taken from the gameio library. Handles game rendering, user input, game state array (all players/objects/etc you can see), and most client packet handling.

About

License:MIT License


Languages

Language:JavaScript 94.3%Language:HTML 3.2%Language:CSS 2.5%Language:Batchfile 0.0%