Relevant Issue: https://github.com/microsoft/pxt-arcade/issues/1242
Describe the bug
When a sprite collides squarely with a wall tile, the “on sprite of kind ___ hits wall ___” block is called twice.
To Reproduce
- Replicate this image in MakeCode Arcade
- Notice that the score is increased twice each time the sprite collides with the green block. This happens in all four directions, as long as the sprite is directly in line with the tile.
Expected behavior
The score should only increase once per collision - the collision event should only be called once.
Demo
Desktop (please complete the following information):
- Windows 10
- Chrome, Firefox
- Arcade 0.14.3, MakeCode 5.21.6
It is very difficult to debug, and so could be off-putting to younger students with little understanding of collision detection.
Can you think of any ways around this?