pxt-arcade icon indicating copy to clipboard operation
pxt-arcade copied to clipboard

Splash block text can fail to show in an on block for wall collision on PyGamer

Open kevinjwalters opened this issue 6 years ago • 3 comments
trafficstars

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:

  1. Write some code which looks like the one included at the end.
  2. 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.
  3. Observe splash text appears most of the time but occasionally the player will appear to freeze and doesn't respond to controls. Pressing A will get things going again but the splash text will not be seen.
  4. Repeat until bored.

Expected behavior I'd expect the splash text to always appear.

Screenshots Here's the code:

arcade-Collision-Splash-Bug-v1-screenshot-code-1

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:

arcade-Collision-Splash-Bug-v1

kevinjwalters avatar Aug 19 '19 22:08 kevinjwalters

@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

kevinjwalters avatar Aug 19 '19 23:08 kevinjwalters

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 avatar Nov 11 '19 00:11 kevinjwalters

@kevinjwalters does this still repro?

abchatra avatar Oct 14 '22 18:10 abchatra