about summary refs log tree commit diff stats
path: root/app/assets
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/wittle/trace2.js12
-rw-r--r--app/assets/javascripts/wittle/utilities.js.erb1
2 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/wittle/trace2.js b/app/assets/javascripts/wittle/trace2.js index e36e4bd..81439e7 100644 --- a/app/assets/javascripts/wittle/trace2.js +++ b/app/assets/javascripts/wittle/trace2.js
@@ -696,7 +696,11 @@ window.onMove = function(dx, dy) {
696 data.path.pop().destroy() 696 data.path.pop().destroy()
697 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_NONE) 697 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_NONE)
698 if (data.puzzle.symType != SYM_TYPE_NONE) { 698 if (data.puzzle.symType != SYM_TYPE_NONE) {
699 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_NONE) 699 if (data.puzzle.getLine(data.sym.x, data.sym.y) == window.LINE_OVERLAP) {
700 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_BLUE)
701 } else {
702 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_NONE)
703 }
700 } 704 }
701 } 705 }
702 706
@@ -713,7 +717,11 @@ window.onMove = function(dx, dy) {
713 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLACK) 717 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLACK)
714 } else { 718 } else {
715 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLUE) 719 data.puzzle.updateCell2(data.pos.x, data.pos.y, 'line', window.LINE_BLUE)
716 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_YELLOW) 720 if (data.puzzle.getLine(data.sym.x, data.sym.y) == window.LINE_BLUE) {
721 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_OVERLAP)
722 } else {
723 data.puzzle.updateCell2(data.sym.x, data.sym.y, 'line', window.LINE_YELLOW)
724 }
717 } 725 }
718 } 726 }
719 } 727 }
diff --git a/app/assets/javascripts/wittle/utilities.js.erb b/app/assets/javascripts/wittle/utilities.js.erb index 6bf3a17..b621003 100644 --- a/app/assets/javascripts/wittle/utilities.js.erb +++ b/app/assets/javascripts/wittle/utilities.js.erb
@@ -129,6 +129,7 @@ window.LINE_NONE = 0
129window.LINE_BLACK = 1 129window.LINE_BLACK = 1
130window.LINE_BLUE = 2 130window.LINE_BLUE = 2
131window.LINE_YELLOW = 3 131window.LINE_YELLOW = 3
132window.LINE_OVERLAP = 4
132window.DOT_NONE = 0 133window.DOT_NONE = 0
133window.DOT_BLACK = 1 134window.DOT_BLACK = 1
134window.DOT_BLUE = 2 135window.DOT_BLUE = 2