Show score toast.

This commit is contained in:
Koen J 2025-07-05 14:07:49 +02:00
commit 5528d71da8

View file

@ -9,6 +9,7 @@ import android.view.MotionEvent
import android.view.View import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator import android.view.animation.AccelerateDecelerateInterpolator
import androidx.core.graphics.toColorInt import androidx.core.graphics.toColorInt
import com.futo.platformplayer.UIDialogs
import kotlin.math.* import kotlin.math.*
import kotlin.random.Random import kotlin.random.Random
@ -128,6 +129,13 @@ class TargetTapLoaderView @JvmOverloads constructor(
} }
fun stopAndResetLoader() { fun stopAndResetLoader() {
if (score > 0) {
val now = System.currentTimeMillis()
val dt = (now - startTime) / 1000.0
UIDialogs.toast("Nice! score was $score, ${"%.${1}f".format(score / dt).toDouble()} (per second)")
score = 0
}
loaderFinished = true loaderFinished = true
targets.clear() targets.clear()
particles.clear() particles.clear()