1.0.23 • Published 6 months ago

slanted-gamedev-toolz v1.0.23

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

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

ParameterDescription
diceSidesthe amount of sides on the dice

Return Value

TypeDescription
numberthe 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

ParameterDescription
diceSidesthe amount of sides on the dice

Return Value

TypeDescription
numberthe 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

ParameterDescription
diceSidesthe amount of sides on the dice

Return Value

TypeDescription
numberthe result of the dice roll
1.0.23

6 months ago

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago