react-raphael-mine-sweeping
so easy! create mine sweeping game with react-raphael!
Install
# or specify the externals in webpack config
npm install --save raphael
# install react-raphael-mine-sweeping in your react-raphael-mine-sweeping project
npm install --save react-raphael-mine-sweeping
Quickly Start
var React = ;var ReactDOM = ;var MineSweeping = ;Component{superprops;thisstate =mineCount: 60xSize: 24ySize: 24openSum: 24 * 24closeSum: 0}{thisrefsmine;this}{this}{var mineCountopenSumcloseSum = thisstate;return <div><div><button onClick=thisreplay>replay</button><span>open box count:</span><span>openSum</span><span>close box count:</span><span>closeSum</span><span>mine count:</span><span>mineCount</span></div><MineSweeping ref="mine" mineCount=60 xSize=24 ySize=24 onClick=thishandleClick/></div>}ReactDOM;
API
All Mine Sweeping Props
- mineCount
number
mine count of the game - xSize
number
column count of the boxs - ySize
number
row count of the boxs - onClick
function
click event of the gamecontext=>{x,y,models,openSum,closeSum}
All Mine Sweeping Ref
- replay
function
replay the game
Contact
Email: liuhong1.happy@163.com