review QML "sokoban"
This commit is contained in:
parent
96cd6e9c99
commit
20e3c27983
9 changed files with 12 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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*)))))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue