increpare / PuzzleScript

Open Source HTML5 Puzzle Game Engine
MIT License
903 stars 159 forks source link

horizontal rules over-expanded? #721

Closed increpare closed 3 years ago

increpare commented 3 years ago

https://www.puzzlescript.net/editor.html?hack=44c3cc19a7691abfb209bbd485c17f55

[ horizontal player ] -> [ target ]

becomes

(83) DOWN [ left player ] -> [ stationary target ]
(83) DOWN [ right player ] -> [ stationary target ]
(83) RIGHT [ left player ] -> [ stationary target ]
(83) RIGHT [ right player ] -> [ stationary target ]
ClementSparrow commented 3 years ago

In my fork I've added a comment a long time ago in the function directionalRule, saying "TODO: should'nt it also include 'perpendicular' and 'parallel' but exclude 'horizontal' and 'vertical'?" I guess it's the source of this problem.

https://github.com/ClementSparrow/Pattern-Script/blob/master/src/js/compiler/rule_parser.js

ClementSparrow commented 3 years ago

The "it" in that comment being the variable defined as:

var relativeDirections = ['^', 'v', '<', '>','horizontal','vertical'];
increpare commented 3 years ago

Lol. You saved me a few hours probably. Thanks.