increpare / PuzzleScript

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

Movement consumption #493

Closed ThatScar closed 4 years ago

ThatScar commented 5 years ago

https://www.puzzlescript.net/editor.html?hack=3d873d66c7d58a8c0e3d5f612afd6eb1 To reproduce:

  1. Move right next to the shark.
  2. Press any direction and observe how the shark jumps diagonally/jumps two tiles/stays stationary.
  3. If you want, undo that last turn and observe how the other directions behave.

Seeing the shark move two tiles is unexpected because there's only one rule executing exactly once and all it should do is teleport the shark one tile. What actually happens is that the shark consumes the movement of the player! This only happens when Shark and Player are on the same collision layer (don't forget to reload the level when messing with layers) which is what makes me think that it is consuming the movement.

In short, the rule [ Player | Shark ] -> [ Shark | ] acts like the rule [ movement Player | Shark ] -> [ movement Shark | ] if and only if Player and Shark are on the same layer.

ThatScar commented 4 years ago

Duplicate of #492