diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 20:15:45 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 20:15:45 -0500 |
commit | 521a44eb720c0dbd8a30b38973fcd0352a22f825 (patch) | |
tree | 2b55ce48546e6fb41a2b9f37925a2f48f9c66cd8 /app/assets | |
parent | 3eb639344c31ecc821c3d5c4151915c107f9bc38 (diff) | |
download | wittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.tar.gz wittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.tar.bz2 wittle-521a44eb720c0dbd8a30b38973fcd0352a22f825.zip |
fix error-correction issues with overlapping lines
Diffstat (limited to 'app/assets')
-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 |