review QML "sokoban"

This commit is contained in:
polos 2017-03-06 17:21:20 +01:00
parent 96cd6e9c99
commit 20e3c27983
9 changed files with 12 additions and 13 deletions

View file

@ -24,7 +24,7 @@ which need to wait for eventual running animations to finish.
See e.g. class:
"qml/ext/NumberAnimation_notify.qml"
"qml/ext/NumberAnimationExt.qml"
TIP

View file

@ -3,14 +3,14 @@ import "../ext/"
Image {
Behavior on x {
NumberAnimation_notify {
NumberAnimationExt {
duration: 150
easing.type: Easing.InQuart
}
}
Behavior on y {
NumberAnimation_notify {
NumberAnimationExt {
duration: 150
easing.type: Easing.InQuart
}

View file

@ -5,14 +5,14 @@ Image {
id: box2
Behavior on x {
NumberAnimation_notify {
NumberAnimationExt {
duration: 150
easing.type: Easing.InQuart
}
}
Behavior on y {
NumberAnimation_notify {
NumberAnimationExt {
duration: 150
easing.type: Easing.InQuart
}
@ -20,7 +20,7 @@ Image {
// final animation
SequentialAnimation_notify {
SequentialAnimationExt {
objectName: "wiggle"
loops: 5

View file

@ -3,14 +3,14 @@ import "../ext/"
Image {
Behavior on x {
NumberAnimation_notify {
NumberAnimationExt {
duration: 120
easing.type: Easing.InOutSine
}
}
Behavior on y {
NumberAnimation_notify {
NumberAnimationExt {
duration: 120
easing.type: Easing.InOutSine
}

View file

@ -18,7 +18,7 @@ Rectangle {
// level change animations
ScaleAnimator_notify {
ScaleAnimatorExt {
objectName: "zoomOut"
target: root
from: 0.8
@ -26,7 +26,7 @@ Rectangle {
duration: 250
}
ScaleAnimator_notify {
ScaleAnimatorExt {
objectName: "zoomIn"
target: root
from: 0

View file

@ -172,18 +172,17 @@
(x:do-string (curr-char row)
(when (char= char curr-char)
(let ((item (first items)))
(|setVisible| item t)
(if (and reset
(find type '(:object :player))
(or (/= (|x| item) x)
(/= (|y| item) y)))
(progn
(qsleep 0.05)
(qml-set item "x" x) ; animate "reset"
(qml-set item "y" y))
(progn
(|setX| item x)
(|setY| item y)))
(|setVisible| item t))
(|setY| item y))))
(setf items (rest items)))
(incf x (first *item-size*))))
(incf y (second *item-size*)))))