mirror of
https://github.com/jlengrand/korge-samples.git
synced 2026-03-10 08:31:18 +00:00
Small adjustments
This commit is contained in:
@@ -35,20 +35,34 @@ fun Board.Cell.setAnimate(type: Chip) {
|
||||
|
||||
fun Board.Cell.highlight(highlight: Boolean) {
|
||||
view["highlight"].play(if (highlight) "highlight" else "none")
|
||||
if (highlight) async {
|
||||
view.tween(
|
||||
(view["chip"]!!::scale..0.1..1.2).easeOutElastic(),
|
||||
//vview::rotationDegrees..0.0..360.0,
|
||||
time = 600
|
||||
)
|
||||
if (highlight) {
|
||||
async {
|
||||
while (true) {
|
||||
val hl = view["highlight"]!!
|
||||
while (true) {
|
||||
hl.tween((hl::alpha..0.7).easeInOutQuad(), time = 300)
|
||||
hl.tween((hl::alpha..1.0).easeInOutQuad(), time = 200)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async {
|
||||
val ch = view["chip"]!!
|
||||
view.tween((ch::scale..0.4).easeOutQuad(), time = 100)
|
||||
view.tween((ch::scale..1.2).easeOutElastic(), time = 300)
|
||||
while (true) {
|
||||
view.tween((ch::scale..1.0).easeOutQuad(), time = 300)
|
||||
view.tween((ch::scale..1.2).easeOutElastic(), time = 300)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun Board.Cell.lowlight(lowlight: Boolean) {
|
||||
async {
|
||||
view.tween(
|
||||
view!!::scale..1.0..0.8,
|
||||
view!!::alpha..0.5,
|
||||
view!!::scale..1.0..0.7,
|
||||
view!!::alpha..0.3,
|
||||
time = 300, easing = Easings.EASE_OUT_QUAD
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user