1.0.23 • Published 3 years ago
slanted-gamedev-toolz v1.0.23
SlantedGameToolz
A collection of functions for use in games.
- dice
- weighted dice
- percentage
Install
$ yarn installrollDice
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
3 years ago
1.0.22
3 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago