0.1.1 • Published 2 years ago

@arcade2d/utils v0.1.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
2 years ago

@arcade2d/utils

Coverage Latest Release

Repository · Website

Game related utilities.

Installation

$ yarn add @arcade2d/utils

Examples

Efficient Mapped Lists

const list = new MappedList<number, string>();

list.add(123, 'abc');
list.add(456, 'def');

for (const { key, value } of list) {
  console.log(key, value);
}

Random Value Generation

const random = new RandomValueProvider();

console.log(random.generate()); // Value between 0 and <1.
console.log(random.inRectangle(10, 20, 100, 150)); // [x, y] tuple between the specified rectangle.
0.1.1

2 years ago

0.1.0

2 years ago