mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-05 00:57:17 +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.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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue