It runs the same way on my pygamer, my ovobot and in the emulator. But it doesn’t at all when I play it on my Raspberry Pi W running pi0.
This is a pretty simple game that isn’t meant to be too challenging. In fact, once you get the hang of it you can play it forever. However on pi0 my character almost always falls to the bottom of the screen before the first cloud. When I do get to hit the cloud he barely slows down. The game is over every time in the opening seconds.
Is this a known issue? Is there something wrong I am doing and/or is there something I can add to my code to adjust for this? Thank you so much!
I tested your game and got the same difference, where it was quite playable in the web simulator, but totally unplayable on the Raspberry Pi(RPi); just falling quickly to the bottom of the screen and getting little to nothing braking/uplift effect while hitting the clouds.
I am no expert on the subject, but there seems to be a difference from the web simulator regarding either:
The way the On sprite of kind Player overlaps otherSprite of kind Food-block works on the RPi; it seems to get only one collision where y position is changed to -1 instead of the sprite getting uplift=-1 as long as the player sprite manages to overlap the cloud, or
The relative speed of the various loops are different somehow on the RPi from the other handhelds and the simulator to which you have “calibrated” the default fall speed and uplift conditions for.
Maybe a combination of both?
-Maybe someone in the @MakeCode team knows what the reasons might be for the difference in behavior between how your original game above behaves in the web simulator and your handheld devices, and how it behaves on a RPi?
But by synchronizing both the default fall speed(changing y=2) and the uplift period(changing y=-1) for every loop inside an on game update every 100ms function and changing getting the uplift as long as the player sprite overlaps the cloud app to fixed(15) number of loops counting down every 100ms iteration, this at least mimics your gameplay somewhat, and the gameplay is similar in both the web simulator and on my RPi:
You could probably fine tune it better than I have done, use different player sprite velocities instead of distances for the fall and uplift, and maybe there is a better solution also to only get uplift only as long as the player sprite overlaps the clouds, like your intention seems to be.
I don’t know enough about game programming or the working of the game loop implementation inside the MakeCode editor, under the hood and between different hardware and the simulator, but I have an idea that it might be an idea to tighten things up in fixed time intervals/loops somehow, instead of many independent forever loops and functions that sleep, even if they sleep for given amounts of time.
Anyone with experience who are able do an optimal implementation to learn from which:
is expected to work identically across all hardware and the simulator, and
is as true as possible to the relative speeds while falling and during uplift in the original game in the simulator, and
while keeping the functionality of only getting uplift while the player is actually overlapping the clouds?