FormularSumo / Star-Wars-Galaxy-Collection

A remake of the discontinued Star Wars Force Collection game https://formularsumo.github.io/Star-Wars-Galaxy-Collection-Web/ https://play.google.com/store/apps/details?id=com.formularsumo.starwarsforcecollectionremake.embed
GNU Affero General Public License v3.0
6 stars 0 forks source link

Fix cards very occasionally going into negative health and moving forward too quickly #25

Closed FormularSumo closed 3 years ago

FormularSumo commented 3 years ago

image Uncommenting this code in gamestate leads to the problems happening

FormularSumo commented 3 years ago

Actually I've just found out that characters can still go into negative health. Movement is entirely fixed and fixing that mostly stopped negative health events happening but not always.

FormularSumo commented 3 years ago

Now it's fixed. Problem was card number wasn't being worked out until cards had moved all the way forward (so first column was in melee position), meaning occasionally when a card tried to delete itself by setting P1/2 deck of it's position to nil it didn't delete itself but tried to delete a non-existant card where it was previously located.

Now number is worked out while cards are moving into position using a different formula (adding math.ceil6-timer) on the end)