diff --git a/desktop/resources/ego/squat.png b/desktop/resources/ego/squat.png
index d19f6a8d..e6934087 100644
Binary files a/desktop/resources/ego/squat.png and b/desktop/resources/ego/squat.png differ
diff --git a/desktop/resources/ego/squat.pxa/4.pxi b/desktop/resources/ego/squat.pxa/4.pxi
new file mode 100644
index 00000000..8dab362f
Binary files /dev/null and b/desktop/resources/ego/squat.pxa/4.pxi differ
diff --git a/desktop/resources/ego/squat.pxa/CelData.plist b/desktop/resources/ego/squat.pxa/CelData.plist
index f0b74d60..1ff35422 100644
--- a/desktop/resources/ego/squat.pxa/CelData.plist
+++ b/desktop/resources/ego/squat.pxa/CelData.plist
@@ -18,5 +18,9 @@
duration
1
+
+ duration
+ 1
+
diff --git a/desktop/resources/inside-house/inputed-key.png b/desktop/resources/inside-house/inputed-key.png
new file mode 100644
index 00000000..875e09e2
Binary files /dev/null and b/desktop/resources/inside-house/inputed-key.png differ
diff --git a/desktop/src-common/advent/screens/safe.clj b/desktop/src-common/advent/screens/safe.clj
index c8729603..97cc8839 100644
--- a/desktop/src-common/advent/screens/safe.clj
+++ b/desktop/src-common/advent/screens/safe.clj
@@ -40,14 +40,20 @@
:on-show
(fn [screen entities]
(update! screen :renderer (stage) :camera (orthographic))
- {:fade (assoc (texture "black.png")
- :scale-x 80
- :scale-y 80
- :opacity 0.7)
- :safe (assoc (texture "inside-house/safe-screen.png") :x start-x :y start-y)
- :start-showing? false
- :shown? false})
+ (let [inputed-key (texture "inside-house/inputed-key.png")]
+ {:fade (assoc (texture "black.png")
+ :scale-x 80
+ :scale-y 80
+ :opacity 0.7)
+ :safe (assoc (texture "inside-house/safe-screen.png") :x start-x :y start-y)
+ :entered-keys (doall (for [i (range 5)]
+ (assoc inputed-key
+ :x (+ start-x 10 (* i 12))
+ :y (+ start-y 56))))
+ :start-showing? false
+ :shown? false}))
+
:on-render
(fn [screen [entities]]
(let [entities (if (:start-showing? entities)
@@ -57,7 +63,8 @@
entities)]
(when (:shown? entities)
- (render! screen [(:fade entities) (:safe entities)]))
+ (render! screen [(:fade entities) (:safe entities)])
+ (render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
entities))
:show-screen (fn [{:keys [success failure]} [entities]]
@@ -76,6 +83,7 @@
(if-let [button (get-button [x y])]
(do (sound! (:sound button) :play)
(let [new-state (update-in entities [:button-choices] #(conj % (:id button)))]
+
(cond (= [4 2 1 5 3] (:button-choices new-state))
(do ((:success entities) (-> @(resolve 'advent.screens.scene/scene)
:entities
diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj
index 73075c25..a5b1a66e 100644
--- a/desktop/src-common/advent/screens/scene.clj
+++ b/desktop/src-common/advent/screens/scene.clj
@@ -99,9 +99,9 @@
(texture (aget stand-sheet 0 i))))
talk-anim (animation 0.2 (for [i (range 8)]
(texture (aget talk-sheet 0 i))))
- start-squat (animation 0.05 (for [i [0 1 2 3]]
+ start-squat (animation 0.05 (for [i [0 1 2 3 4]]
(texture (aget squat-sheet 0 i))))
- end-squat (animation 0.05 (for [i [3 2 1 0]]
+ end-squat (animation 0.05 (for [i [4 3 2 1 0]]
(texture (aget squat-sheet 0 i))))
squat-anim (animation 0.05 (for [i [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 2 1] ]
(texture (aget squat-sheet 0 i))))