Explosion sounds

This commit is contained in:
zenoamaro committed 2019-06-26 22:48:31 +02:00
1 parent 512b256e2e
commit ea89cbc2cc
3 files changed
+31 -10

No files matched your search

+4 -1
View File
@@ -1,4 +1,3 @@
export function index2coords(width, i) {
return [i % width, Math.floor(i/width)];
}
@@ -27,6 +26,10 @@ export function wrap(min, x, max) {
return ((x-min + max-min) % (max-min)) + min;
}
export function cycle(x, d) {
return Math.floor(x / d);
}
export function within(x, y, tx, ty, r) {
return Math.abs(x-tx) < r && Math.abs(y-ty) < r;
}