1.0.23 • Published 2 years ago
slanted-gamedev-toolz v1.0.23
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 |
1.0.23
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.9
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago