diff options
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/wittle/trace2.js | 12 | ||||
-rw-r--r-- | app/assets/javascripts/wittle/utilities.js.erb | 1 |
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 | |||
129 | window.LINE_BLACK = 1 | 129 | window.LINE_BLACK = 1 |
130 | window.LINE_BLUE = 2 | 130 | window.LINE_BLUE = 2 |
131 | window.LINE_YELLOW = 3 | 131 | window.LINE_YELLOW = 3 |
132 | window.LINE_OVERLAP = 4 | ||
132 | window.DOT_NONE = 0 | 133 | window.DOT_NONE = 0 |
133 | window.DOT_BLACK = 1 | 134 | window.DOT_BLACK = 1 |
134 | window.DOT_BLUE = 2 | 135 | window.DOT_BLUE = 2 |