alset-reactgame-test
v0.1.8
Published
ALSET ReactGame component to build and create interactive games.
Downloads
21
Readme
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
- gemCollector
- squadGemCollector
- squad
- singlePlayerTwoWindows
Type of modes
- player-vs-player
- player-vs-bot
- bot-vs-bot
- bot-vs-custom-code( also send props showCodeEditor={true})