UNPKG

slanted-gamedev-toolz

Version:

A slanted mix of tools for your brilliant ideas in game design.

7 lines (6 loc) 207 B
export const rollDice = (diceSides) => { const hitDie = diceSides; const thisRollValue = Math.floor(Math.random() * hitDie + 1); return thisRollValue; }; console.log("rollDice(5)", rollDice(5));