UNPKG

tin-engine

Version:

Simple game engine to make small canvas based games using es6

14 lines (12 loc) 301 B
import V2 from '../geo/v2.js'; export default { between(min, max) { return () => Math.random() * (max-min) + min; }, vector(x, y) { return () => new V2( typeof x == 'function' ? x() : x, typeof y == 'function' ? y() : y ); } };