summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/engine/mover.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-04-24 18:52:55 -0400
committerJules Laplace <jules@okfoc.us>2014-04-24 18:52:55 -0400
commit6a39854726c511f3df0b4aff619ecac1943c993c (patch)
tree2b9ca54a08523eb6559f2d36a5e240e98a8d09bc /assets/javascripts/rectangles/engine/mover.js
parent0e4bc72fe453797743d63f57db47ef3e0468fc65 (diff)
trying to add a slight margin to the walls
Diffstat (limited to 'assets/javascripts/rectangles/engine/mover.js')
-rw-r--r--assets/javascripts/rectangles/engine/mover.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/assets/javascripts/rectangles/engine/mover.js b/assets/javascripts/rectangles/engine/mover.js
index 66c1813..71656ef 100644
--- a/assets/javascripts/rectangles/engine/mover.js
+++ b/assets/javascripts/rectangles/engine/mover.js
@@ -28,12 +28,15 @@ var mover = new function(){
}
// check if we've breached one of the walls.. clamp position if so
- var collision = base.room.collides(pos.x, pos.z, radius)
+ var collision = base.room.collidesDisc(pos.x, pos.z, radius)
if (collision) {
if (! (collision & LEFT_RIGHT)) {
cam.x = base.room.rect.x.clampDisc(pos.x, radius)
}
+ else {
+ // cam.x = base.room.rect.x.clampDisc(pos.x, radius)
+ }
if (! (collision & FRONT_BACK)) {
cam.z = base.room.rect.y.clampDisc(pos.z, radius)
}