summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/map/_map.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/javascripts/rectangles/map/_map.js')
-rw-r--r--assets/javascripts/rectangles/map/_map.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/assets/javascripts/rectangles/map/_map.js b/assets/javascripts/rectangles/map/_map.js
index d8fdc79..64013cd 100644
--- a/assets/javascripts/rectangles/map/_map.js
+++ b/assets/javascripts/rectangles/map/_map.js
@@ -7,6 +7,12 @@ var map = new function(){
var base = this
base.bounds = new vec2(500,500)
base.center = new vec2(0,0)
+
+ base.sides = function(){
+ var sides = base.bounds.clone().div(2).div(base.zoom)
+ return new rect( base.center.a - sides.a, base.center.b - sides.b,
+ base.center.a + sides.a, base.center.b + sides.b )
+ }
base.zoom = 1/4