GithubHelp home page GithubHelp logo

swift-ninja-game's Introduction

Teknack Reference Game

This repository is for reference while making your game

To run the game:

$ git clone https://gitlab.com/vineeth22/teknack-reference-game.git
$ cd teknack-reference-game
$ npm install
$ node app.js

Then go to http://localhost:3000

Make sure you follow the following points while coding the backend of your game

This reference game follows the points given here

Use npm

Initialize your node project

$ npm init

Install modules using the following command

It will install the module and add it as a dependency of your project to the project's package.json as an entry in dependencies

$ npm install express --save

Install modules present in the package.json file

$ npm install

Create a .gitignore file

Create a .gitignore file so that node_modules folder is not pushed to your git repository

You can use the .gitignore file present in this repository

Sessions

(Very important)

Your game should take the username from the session cookies.

Refer app.js file

Copy the session code present in app.js file

The code takes the username if the session is not set and sets the session

After that, username should be accessed using req.sess.username variable or using socket.request.sess.username inside sockets

Do not change the value of req.sess.username anywhere in your code

The code is required to integrate the game on the teknack servers

Use http://localhost:3000/unsetSession to unset session and reset username

The code requires express, client-sessions and body-parser module, so install it using npm

swift-ninja-game's People

Contributors

mitchelle-creado-15-06-1997 avatar

Watchers

James Cloos 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.