Casino game script

Casino game script

{H1}

Search code, repositories, users, issues, pull requests

Welcome to the casino roulette documentation. This is the plain HTML, CSS and JS (TypeScript) casino roulette implementation that is originally written using JSX but compiles to plain JS by Babel.

Live example - thisisnl.nl

If you need the same for your React project, take a look at - thisisnl.nl

wheel

Where * means required

OptnTypeDefault valueDescription
id*-The wheel render element id
type*-The wheel type: American or European
<divid="roulette-wheel"></div>
constwheel=newRouletteWheel({id: 'roulette-wheel',type: 'American',});
MethodArgumentsDescription
changeTypeNew wheel type. American or European
doSpinStart spinning wheel function. It takes a number of a winning bet on the wheel and a function which will be called when the wheel stop spinning (optional argument)
thisisnl.nlntListener('click',()=>{thisisnl.nl('0',()=>thisisnl.nl('done'));});thisisnl.nlntListener('click',()=>{thisisnl.nlType('European');});

table

Where * means required

OptTypeDefault valueDescription
id*-The table render element id
type*-The table type: American or European
bets*-The table bets. Type: { [key: string]: { icon?: string; } }
onBet*-Function which handles user bets
<divid="roulette-table"></div>
constbets={};consthandleBet=(bet)=>{bets[thisisnl.nl]={};thisisnl.nl();};consttable=newRouletteTable({id: 'roulette-table',type: 'American', bets,onBet: handleBet,});
MethodArgumentsDescription
changeTypeNew table type. American or European
renderRenders the table with updated data. Call this method every time your bets object changes
consthandleBet=(bet)=>{// thisisnl.nl();// };thisisnl.nlntListener('click',()=>{thisisnl.nlType('European');});
  • - tests
  • - dev
  • - production. See for the folder

Make sure you link the roulette css & js file.

Источник: thisisnl.nl