llaske / sugarizer

Sugarizer is a web implementation of the Sugar platform to run on any device or browser
https://sugarizer.org
Apache License 2.0
197 stars 412 forks source link

Fixed bug preventing pausing when the ball is on the bar #1512

Closed AhmedFatthy1040 closed 7 months ago

AhmedFatthy1040 commented 7 months ago

Fixes #1511

This pull request addresses a bug that allowed players to pause the game while the ball was on the slope, leading to unintended behavior and allowing exploitation of the game mechanics to bypass the maximum turn limit.

The fix introduces a condition to disable the pause functionality when the ball is on the bar after the first round, ensuring that players cannot pause the game during critical moments of gameplay.

@llaske Screenshot_20240128_084807

llaske commented 7 months ago

Doesn't fix the issue on my side. Did you test it? @Vishalk91-4 can you test on your side too?

AhmedFatthy1040 commented 7 months ago

I tested it on my end before submitting the PR, but evidently, I didn't cover all the corner cases. Upon retesting, I discovered that the issue persisted in the initial round, but subsequent rounds resolved it. I'll try to fix it.

Vishalk91-4 commented 7 months ago

Doesn't fix the issue on my side. Did you test it? @Vishalk91-4 can you test on your side too?

Yes Sure, testing now

Vishalk91-4 commented 7 months ago

Doesn't fix the issue on my side. Did you test it? @Vishalk91-4 can you test on your side too?

Checked it multiple times, doesn't fix the issue on my side either

AhmedFatthy1040 commented 7 months ago

I have made a new commit, and fixed the corner cases. it's working fine on my end now. @llaske @Vishalk91-4

Vishalk91-4 commented 7 months ago

@llaske, the fix doesn't allow users to pause during the time before and after the ball is being hit Working for me now.

llaske commented 7 months ago

Merge manually in https://github.com/llaske/sugarizer/commit/fa241350a191b6467a213a49c7c813306e0995d3 As mentioned here, please @AhmedFatthy1040 send PR only on dev branch.