pxt-arcade
pxt-arcade copied to clipboard
Splash block text can fail to show in an on block for wall collision on PyGamer
Describe the bug
While testing some code we noticed that there was a problem with the splash block failing to show the text on screen occasionally. I don't think this occurs in the simulator, we have only seen it on the PyGamer. It's not predictable when it occurs. This is compiled on beta beta (0.13.22 5.19.9).
I've reproduced it in a far shorter version of the code and if you load this up on a PyGamer then about 1 in 20 times when the player hits the wall it will fail to show the splash screen. Pressing A will continue, it's as if the runtime forgets to update the display or thinks it already has - everything else is ok.
I know the forever block has no need to and probably shouldn't rattle away at camera follow sprite. I did try moving that into initLevel1 and it may have fixed it or dramatically reduced the likelihood of occurrence. I'd still say this needs investigating as it suggests there's a race condition somewhere. Note the frequency of occurrence may increase if the pause block is replaced with a second (unnecessary) destroy block for mySprite.
To Reproduce Steps to reproduce the behavior:
- Write some code which looks like the one included at the end.
- Play the game repeatedly walking into the wall, perhaps in different places, with a bit of pausing, perhaps walking in "short steps" into the wall.
- Observe
splashtext appears most of the time but occasionally the player will appear to freeze and doesn't respond to controls. PressingAwill get things going again but thesplashtext will not be seen. - Repeat until bored.
Expected behavior
I'd expect the splash text to always appear.
Screenshots Here's the code:

The game being played and the bug reproduced (got very lucky, second collision!) can be seen on: MakeCode Arcade splash failure in on block for wall collision (YouTube).
Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome
- Version: 76.0.3809.100
Device
- Device: PyGamer
- OS: bootloader v3.7.0
Additional context Here's code embedded in png:

@jwunderl mentions in latter posts in https://forum.makecode.com/t/display-update-flushing-and-synchronisation-and-light-sensor-peculiarities/443/2 that a likely fix is https://github.com/microsoft/pxt-common-packages/pull/889 associated with #1135
Any news on fixing this one? I still see problems with 0.14.9 / 5.12.4 which sometimes doesn't show the splash screen and sometimes doesn't put it in the correct screen position. This messes up one of our applications.
@kevinjwalters does this still repro?