diff options
Diffstat (limited to 'js/matrix.js')
| -rw-r--r-- | js/matrix.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/js/matrix.js b/js/matrix.js index 275e6b6..de59e17 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -151,6 +151,13 @@ Matrix.prototype.getCell = function(x,y){ if (this.aa[y] && this.aa[y][x]) return this.aa[y][x] else return null } +Matrix.prototype.get = function(x,y){ + y = floor(mod(y || 0, this.h)) + x = floor(mod(x || 0, this.w)) + if (this.aa[y] && this.aa[y][x]) return this.aa[y][x] + else return null +} + Matrix.prototype.resize = function(w,h){ w = w || canvas.w h = h || canvas.h |
