adding parallax

This commit is contained in:
2015-05-02 18:49:16 -07:00
parent 55259389f7
commit c3d2c4058d
13 changed files with 20 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -295,7 +295,8 @@
(actions/talk entities :ego "Ye Ol' Antique Shoppe."))}
:background-houses {:box [84 145 126 180]
:script (actions/get-script entities
(actions/walk-to entities :ego [79 145] :face :right)
(actions/walk-to entities :ego [79 145] :face :right :stop? false)
(actions/walk-straight-to entities :ego [92 150] :face :right)
(actions/transition-background entities :outside-jail [159 -20])
(actions/walk-straight-to entities :ego [159 20]))
:cursor :right}
@@ -316,10 +317,13 @@
:ego "One day, when I'm a knight, I'll ask her to be my girlfriend.")
(actions/in-love entities))}}
:layers {:day [(assoc (texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "inside-castle/way-back-tree.png") :x 0 :y 0 :baseline 97)
(assoc (texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]
:night [(assoc (texture "inside-castle/background-dark.png") :x 0 :y 0 :baseline 0)]
:night [(assoc (texture "inside-castle/background-dark.png") :x 0 :y 0 :baseline 0)
(assoc (texture "inside-castle/way-back-tree-dark.png") :x 0 :y 0 :baseline 97)]
:sunrise [(assoc (texture "inside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]}
(assoc (texture "inside-castle/roof.png") :x (- 320 57) :y 0 :baseline 240 :parallax 1.5)]}
:blackout (assoc (texture "black.png")
:x 0 :y 0
:width 320

View File

@@ -295,10 +295,13 @@
(actions/talk entities :ego "No one will notice one missing.")
(actions/give entities :carrot))))}}
:layers {:day [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "outside-castle/brush.png") :origin-x 0 :origin-y 0 :scale-x 1.0 :scale-y 1.0 :x 15 :y 0 :baseline 240 :parallax 1.2)
(assoc (texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 240)]
:night [(assoc (texture "outside-castle/background-dark.png") :x 0 :y 0 :baseline 0)
(assoc (texture "outside-castle/brush-dark.png") :origin-x 0 :origin-y 0 :scale-x 1.0 :scale-y 1.0 :x 15 :y 0 :baseline 240 :parallax 1.2)
(assoc (texture "outside-castle/walk-behind-dark.png") :x 0 :y 0 :baseline 240)]
:sunrise [(assoc (texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "outside-castle/brush.png") :origin-x 0 :origin-y 0 :scale-x 1.0 :scale-y 1.0 :x 15 :y 0 :baseline 240 :parallax 1.2)
(assoc (texture "outside-castle/walk-behind.png") :x 0 :y 0 :baseline 240)]}
:entities {:peddler (actions/start-animation screen
(assoc (texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil

View File

@@ -93,8 +93,8 @@
:script (actions/get-script entities
(actions/walk-to entities :ego [159 5])
(actions/walk-straight-to entities :ego [159 -20])
(actions/transition-background entities :inside-castle [79 145]
)
(actions/transition-background entities :inside-castle [92 150])
(actions/walk-straight-to entities :ego [79 145] :stop? false)
(actions/walk-to entities :ego [159 74]))
:cursor :down}
:door {:box [22 42 46 124]
@@ -133,7 +133,10 @@
(actions/walk-to entities :ego [170 71] :face :right)
(actions/walk-straight-to entities :ego [188 71] :face :right)
(actions/play-animation entities :ego :reach)
(actions/remove-entity entities :axe)
(actions/play-animation entities :ego :axe-wood)
(actions/play-animation entities :ego :reach)
(actions/add-entity entities :axe (get-in @entities [:room [:axe (get-in @entities [:state :time])]]))
(actions/walk-straight-to entities :ego [170 71]))
:scripts {:alarm-clock (actions/get-script entities
(actions/walk-to entities :ego [170 71] :face :right)
@@ -163,9 +166,7 @@
:script (actions/get-script entities
(actions/walk-to entities :ego [151 119] :face :right)
(actions/play-animation entities :ego :reach)
(actions/do-dialogue entities :ego "Ahh, life-giving water."
:ego "I feel strength."
:ego "And renewal!"))
(actions/do-dialogue entities :ego "Ahh, life-giving water."))
:scripts {:flask-2 (actions/get-script entities
(actions/walk-to entities :ego [151 119] :face :right)
(actions/play-animation entities :ego :reach)
@@ -188,6 +189,9 @@
:x 172
:y 140
:baseline 114)}
[:axe :day] (rooms/make-entity :axe (assoc (texture "outside-jail/axe.png") :x 213 :y 63 :baseline 176))
[:axe :night] (rooms/make-entity :axe (assoc (texture "outside-jail/axe-dark.png") :x 213 :y 63 :baseline 176))
:guard (rooms/make-entity :guard (assoc (animation->texture screen guard-stand)
:x 70 :y 55 :baseline 185
:stand guard-stand
@@ -217,6 +221,7 @@
:start-pos [145 15]
:apply-state (fn [entities]
(as-> entities entities
(assoc-in entities [:room :entities :axe] (get-in entities [:room [:axe (get-in entities [:state :time])]]))
(if (= :night (get-in entities [:state :time]))
(make-night entities)
entities)