summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/rectangles/engine/rooms
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/rectangles/engine/rooms')
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/_walls.js15
-rw-r--r--public/assets/javascripts/rectangles/engine/rooms/mover.js5
2 files changed, 12 insertions, 8 deletions
diff --git a/public/assets/javascripts/rectangles/engine/rooms/_walls.js b/public/assets/javascripts/rectangles/engine/rooms/_walls.js
index 25b1c58..04d0594 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/_walls.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/_walls.js
@@ -40,12 +40,17 @@
base.colors = {}
base.init = function(){
- base.colors = {
- wall: app.defaults.colors.wall.slice(),
- outline: app.defaults.colors.outline.slice(),
- floor: app.defaults.colors.floor.slice(),
- ceiling: app.defaults.colors.ceiling.slice(),
+ base.colors = base.copyColors( app.defaults.colors )
+ }
+
+ base.copyColors = function(colors){
+ var copy = {
+ wall: colors.wall.slice(),
+ outline: colors.outline.slice(),
+ floor: colors.floor.slice(),
+ ceiling: colors.ceiling.slice(),
}
+ return copy
}
base.first = function(){
diff --git a/public/assets/javascripts/rectangles/engine/rooms/mover.js b/public/assets/javascripts/rectangles/engine/rooms/mover.js
index 5682be8..ac27aba 100644
--- a/public/assets/javascripts/rectangles/engine/rooms/mover.js
+++ b/public/assets/javascripts/rectangles/engine/rooms/mover.js
@@ -117,7 +117,6 @@ Rooms.mover = new function(){
wall.get_points(wall_vec)
-
t = perp(origins, wall_vec) / ( perp(cursor_copy, wall_vec) || 0.0000001 )
if ( min_t < t || t < 0 || 1 < t ) return
@@ -240,13 +239,13 @@ Rooms.mover = new function(){
wall_vec.normalize = function(){
var carry
if (this.x.a > this.y.a) {
- console.log("SWAP X")
+// console.log("SWAP X")
carry = this.x.a
this.x.a = this.y.a
this.y.a = carry
}
if (this.x.b > this.y.b) {
- console.log("SWAP Y")
+// console.log("SWAP Y")
carry = this.x.b
this.x.b = this.y.b
this.y.b = carry