Explosion sounds
This commit is contained in:
1 parent
512b256e2e
commit
ea89cbc2cc
3 files changed
+31
-10
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user