Browser action game project
This repository should not be treated as a real finished game for now. The code is constantly being refactored in one place or another, and some features might not work at the moment.
- WebGL graphics
- Client-server architecture
- Map editor
- Realistic explosions
- Clone the repo
git clone https://github.com/JakMobius/tanks/
- Navigate to project folder
cd tanks
- Install dependencies
npm install
- To build server from sources, type the following command:
npm run build
- To start server with default settings, simply type
node dist
-
-script <script name>
This flag is used for running scripts as soon as server starts. Server scripts are located under
src/server/scripts
directory.This flag can also be used with
-s
alias. -
-preference-string <key>=<value>
This flag is used for setting up your server preferences right before server starts. For example, if your database is located at a new address, you should use this flag as following:
-preference-string database.url=mongodb://new-database-host:27017
This flag can also be used with
-ps
alias.You should only use this flag when you want to overwrite a string. If you want to set up a port or something else that is not a string, use one of the flags listed below
-
-preference-number <key>=<value>
Use this flag to overwrite setting with a number
This flag can also be used with
-pn
alias. -
-preference-boolean <key>=<value>
Use this flag to overwrite setting with a boolean
Value can either be:
yes
,true
or1
meantrue
no
,false
or0
meanfalse
This flag can also be used with
-pb
alias.
-
To configure the server port and database credentials, edit the
dist/server/server-preferences.json
file. If this file does not exist, start the server once. The default configuration file will be created.Note: your custom preferences file is listed in .gitignore, so your database password and other confidential data will not be shared
-
By default, the server only binds the port specified in the configuration. To start the game room and enter the game, you must first start the corresponding server modules using the
service
command. In the future this feature will help to create distributed systems where the hub and the game server can be located on different servers. For now it is enough to enterservice on
command to start the web-server and the game socket. After that you can use theroom create
command to create a game room. Then you will be able to go tolocalhost:port/game
and play the game.Note: If you use the
-s autorun
flag when starting the server, or run therun autorun
command in the server console, the server will automatically start all necessary modules and create several game rooms.