slanted-gamedev-toolz
TypeScript icon, indicating that this package has built-in type declarations

1.0.23 • Public • Published

SlantedGameToolz

A collection of functions for use in games.

  • dice
  • weighted dice
  • percentage

Install

$ yarn install

rollDice

A fair dice roll.

Usage

import { rollDice } from "slanted-gamedev-toolz";

const diceSides = 6
const diceRollOutcome = rollDice(diceSides);

Parameters

Parameter Description
diceSides the amount of sides on the dice

Return Value

Type Description
number the result of the dice roll

rollLowWeightedDice

An unfair fair dice roll that is more likely to roll low.

Usage

import { rollLowWeightedDice } from "slanted-gamedev-toolz";

const diceSides = 6
const diceRollOutcome = rollLowWeightedDice(diceSides);

Parameters

Parameter Description
diceSides the amount of sides on the dice

Return Value

Type Description
number the result of the dice roll

rollHighWeightedDice

An unfair fair dice roll that is more likely to roll high.

Usage

import { rollHighWeightedDice } from "slanted-gamedev-toolz";

const diceSides = 6
const diceRollOutcome = rollHighWeightedDice(diceSides);

Parameters

Parameter Description
diceSides the amount of sides on the dice

Return Value

Type Description
number the result of the dice roll

Package Sidebar

Install

npm i slanted-gamedev-toolz

Weekly Downloads

4

Version

1.0.23

License

ISC

Unpacked Size

56.2 kB

Total Files

51

Last publish

Collaborators

  • the_slanted_room