Coder Social home page Coder Social logo

alset-reactgame's Introduction

Directory Structure

  • Src Folder

    All of the package code is here. Hit yarn package:lint and yarn package:build command after finishing up with coding the package.

  • Build Folder

    Build of the Src folder + package.json file and can be deploy to NPMjs from here.

  • App Folder

    Testing of the package can be done here. Alset-ReactGame component directly import here from Build folder. To start the local dev server Run yarn start

Installation of Package

npm i alset-reactgame-test --save

How To Use The Package

Props :

 <ALSET-ReactGame
                game={String}                     // defaults -> Squad
                showCodeEditor={boolean}          // defaults -> false
                mode={String}                     // defaults -> player-vs-bot
                player1Keys = {obj}  // defaults -> {left:'s',right:'f', up:'e', down:'d', action:'w'}
                player2Keys = {obj}  // defaults -> {left:'j',right:'l', up:'i', down:'k', action:'p'}
            />

Example :

import React from 'react';
import AlsetReactGame from 'alset-reactgame-test';

const Game =(props)=>{
    const playerKeys={left:'1',right:'3', up:'5', down:'2', action:'0'}
    return <ALSET-ReactGame
                game='squad'                     
                showCodeEditor={false}          
                mode={'player-vs-bot'}                     
                player1Keys = {playerKeys}
            />
}

export default Game;

Type of games

  1. gemCollector
  2. squadGemCollector
  3. squad
  4. singlePlayerTwoWindows

Type of modes

  1. player-vs-player
  2. player-vs-bot
  3. bot-vs-bot
  4. bot-vs-custom-code( also send props showCodeEditor={true})

alset-reactgame's People

Contributors

mkoth avatar walkwel avatar walkwel-tech avatar

Watchers

 avatar

Forkers

mkoth nus-alset

alset-reactgame's Issues

Old game used and its not changing

https://github.com/MKoth/ALSET-game
I've updated this system with three games created latest, should those games be brought in here?
Because in description there is written that this system got three types of games, but when I installed them via npm, like its written at description it appeared that no matter what game I'm setting, gemCollector game only appearing

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.