mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-03 08:10:06 +00:00
Show score toast.
This commit is contained in:
parent
83f520ca44
commit
5528d71da8
1 changed files with 8 additions and 0 deletions
|
@ -9,6 +9,7 @@ import android.view.MotionEvent
|
|||
import android.view.View
|
||||
import android.view.animation.AccelerateDecelerateInterpolator
|
||||
import androidx.core.graphics.toColorInt
|
||||
import com.futo.platformplayer.UIDialogs
|
||||
import kotlin.math.*
|
||||
import kotlin.random.Random
|
||||
|
||||
|
@ -128,6 +129,13 @@ class TargetTapLoaderView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
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
|
||||
targets.clear()
|
||||
particles.clear()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue