osudroid / osu-droid

http://osudroid.moe
Apache License 2.0
498 stars 74 forks source link

Hit circle game objects are pooled too early #347

Open Rian8337 opened 3 weeks ago

Rian8337 commented 3 weeks ago

As the title says. This causes its animation to not finish properly after judgement, and its state will remain until it is reused, as shown in the video below.

https://github.com/osudroid/osu-droid/assets/52914632/2dd3ce8a-c6c1-4267-be05-028c9377cf1e

Reco1I commented 2 weeks ago

https://github.com/osudroid/osu-droid/blob/master/src%2Fru%2Fnsu%2Fccfit%2Fzuev%2Fosu%2Fgame%2FSpritePool.java#L33-L54

The issue is here exactly. The sprite gets reset before using it back, this is indeed caused by what the title says.

There's a thing with SpritePool, I personally believe that it's not necessary since hit objects are already pooled by GameObjectPool.