Sprite/Wall Collision Event Repeated

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

  1. Replicate this image in MakeCode Arcade
  2. 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.


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?

It looks like alignment is a critical factor in triggering this bug.

Having said that, I’m wondering if this is related to Wall collisions and sprite vy. That also has two events where the velocity value is the impact velocity. Or is that something else?