Merge branch 'master' of https://bitbucket.org/brycecovertoperations/advent
This commit is contained in:
BIN
desktop/resources/ego/axe-wood.png
Normal file
BIN
desktop/resources/ego/axe-wood.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
BIN
desktop/resources/ego/axe.png
Normal file
BIN
desktop/resources/ego/axe.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
desktop/resources/ego/axe.pxa/0.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/1.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/2.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/3.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/4.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/5.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/axe.pxa/6.pxi
Normal file
BIN
desktop/resources/ego/axe.pxa/6.pxi
Normal file
Binary file not shown.
34
desktop/resources/ego/axe.pxa/CelData.plist
Normal file
34
desktop/resources/ego/axe.pxa/CelData.plist
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
BIN
desktop/resources/outside-jail/Untitled.png
Normal file
BIN
desktop/resources/outside-jail/Untitled.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.1 KiB |
BIN
desktop/resources/outside-jail/axe-wood.pxa/0.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/1.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/10.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/10.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/2.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/3.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/4.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/5.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/6.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/6.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/7.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/7.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/8.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/8.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe-wood.pxa/9.pxi
Normal file
BIN
desktop/resources/outside-jail/axe-wood.pxa/9.pxi
Normal file
Binary file not shown.
50
desktop/resources/outside-jail/axe-wood.pxa/CelData.plist
Normal file
50
desktop/resources/outside-jail/axe-wood.pxa/CelData.plist
Normal file
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
BIN
desktop/resources/outside-jail/axe.pxa/0.pxi
Normal file
BIN
desktop/resources/outside-jail/axe.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe.pxa/1.pxi
Normal file
BIN
desktop/resources/outside-jail/axe.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe.pxa/2.pxi
Normal file
BIN
desktop/resources/outside-jail/axe.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe.pxa/3.pxi
Normal file
BIN
desktop/resources/outside-jail/axe.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/outside-jail/axe.pxa/4.pxi
Normal file
BIN
desktop/resources/outside-jail/axe.pxa/4.pxi
Normal file
Binary file not shown.
26
desktop/resources/outside-jail/axe.pxa/CelData.plist
Normal file
26
desktop/resources/outside-jail/axe.pxa/CelData.plist
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
BIN
desktop/resources/outside-jail/axe2.pxi
Normal file
BIN
desktop/resources/outside-jail/axe2.pxi
Normal file
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 49 KiB |
40
desktop/src-common/advent/screens/fade.clj
Normal file
40
desktop/src-common/advent/screens/fade.clj
Normal file
@@ -0,0 +1,40 @@
|
||||
(ns advent.screens.fade
|
||||
(:require [play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
[advent.pathfind]
|
||||
[advent.zone :as zone]
|
||||
[advent.utils :as utils])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
(defscreen fade-screen
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(utils/setup-viewport screen 320 240)
|
||||
|
||||
{:fade (assoc (texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
:opacity 0.0
|
||||
:origin-x 0
|
||||
:origin-y 0)})
|
||||
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(render! screen [(:fade entities)])
|
||||
entities)
|
||||
|
||||
:update-fade (fn [{:keys [opacity]} [entities]]
|
||||
(assoc-in entities [:fade :opacity] opacity))
|
||||
|
||||
:on-resize (fn [{:keys [width height viewport]} entities]
|
||||
(.update viewport width height)))
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
[clojure.pprint]
|
||||
[advent.pathfind]
|
||||
[advent.zone :as zone]
|
||||
[advent.tween :as tween]
|
||||
[advent.utils :as utils])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
@@ -14,11 +15,11 @@
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]))
|
||||
|
||||
|
||||
(defn close [entities]
|
||||
(defn close [screen entities]
|
||||
(screen! @(resolve 'advent.screens.scene/scene) :on-reactivate)
|
||||
(-> entities
|
||||
(assoc :shown? false)
|
||||
(assoc :start-showing? false)))
|
||||
(assoc-in [:tweens :fade-out] (tween/tween :fade-out screen [:opacity] 1.0 0.0 0.2 :ease tween/ease-out-cubic
|
||||
:finish #(assoc % :shown? false)))))
|
||||
|
||||
|
||||
(defscreen inventory-screen
|
||||
@@ -26,9 +27,9 @@
|
||||
(fn [screen entities]
|
||||
(utils/setup-viewport screen 1280 960)
|
||||
|
||||
(let [highlighted-text (assoc (label "Hello" (style :label (utils/get-font "ego/font.fnt") (color :white))) :x 0 :y 850 :width 1280)]
|
||||
(let [highlighted-text (assoc (label "Hello" (style :label (utils/get-font "ego/font.fnt") (color :white))) :x 0 :y 850 :width 1280 )]
|
||||
(label! highlighted-text :set-alignment Align/center)
|
||||
{:overlay (assoc (texture "inventory-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0)
|
||||
{:overlay (assoc (texture "inventory-overlay.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :opacity 0.0)
|
||||
:fade (assoc (texture "black.png")
|
||||
:scale-x 80
|
||||
:scale-y 80
|
||||
@@ -38,19 +39,25 @@
|
||||
:all-items (texture! (texture (pixmap "cursor.png")) :split 16 16)
|
||||
:items []
|
||||
:shown? false
|
||||
:start-showing? false
|
||||
:highlighted-item nil
|
||||
:opacity 0.0
|
||||
:tweens {}
|
||||
:highlighted-text highlighted-text}))
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(let [entities (if (:start-showing? entities)
|
||||
(-> entities
|
||||
(assoc :start-showing? false)
|
||||
(assoc :shown? true))
|
||||
entities)]
|
||||
(let [
|
||||
entities (utils/apply-tweens screen entities (:tweens entities))
|
||||
opacity (get-in entities [:opacity])
|
||||
entities (-> entities
|
||||
(assoc-in [:overlay :opacity] opacity)
|
||||
(assoc-in [:fade :opacity] (* 0.6 opacity))
|
||||
(assoc-in [:highlighted-text :opacity] opacity)
|
||||
(update-in [:items] (fn [i]
|
||||
(map #(assoc % :opacity opacity) i))))]
|
||||
|
||||
(when (:shown? entities)
|
||||
(doto (:highlighted-text entities) (label! :set-color (color 1 1 1 opacity)))
|
||||
(render! screen [(:fade entities) (:overlay entities)])
|
||||
(render! screen (:items entities))
|
||||
(if-let [item (:highlighted-item entities)]
|
||||
@@ -59,28 +66,34 @@
|
||||
(render! screen [(:highlighted-text entities)]))
|
||||
entities))
|
||||
|
||||
:show-screen (fn [{items :items} [entities]]
|
||||
(assoc entities :start-showing? true
|
||||
:items (for [[item index] (map vector items (range))
|
||||
:let [row (int (/ index 8))
|
||||
column (mod index 8)
|
||||
base-x (* 79 4)
|
||||
base-y (* 180 4)
|
||||
x (+ base-x (* column (* 24 4)))
|
||||
y (- base-y (* row (* 24 4)))
|
||||
item-width 16
|
||||
offset-x (+ x (/ item-width 2))
|
||||
offset-y (+ y (/ item-width 2))
|
||||
padding (/ item-width 2)
|
||||
padding (* 4 padding)]]
|
||||
(assoc (texture (aget (:all-items entities) 0 (.indexOf utils/+all-cursors+ (:cursor item))))
|
||||
:x x :y y
|
||||
:scale-x 4
|
||||
:scale-y 4
|
||||
:origin-x 0
|
||||
:origin-y 0
|
||||
:item item
|
||||
:box (zone/box (- offset-x padding) (- offset-y padding) (+ offset-x item-width padding) (+ offset-y item-width padding))))))
|
||||
:show-screen (fn [{items :items :as screen} [entities]]
|
||||
(if (:shown? entities)
|
||||
entities
|
||||
|
||||
(-> entities
|
||||
(assoc :shown? true
|
||||
:opacity 0.0
|
||||
:items (for [[item index] (map vector items (range))
|
||||
:let [row (int (/ index 8))
|
||||
column (mod index 8)
|
||||
base-x (* 79 4)
|
||||
base-y (* 180 4)
|
||||
x (+ base-x (* column (* 24 4)))
|
||||
y (- base-y (* row (* 24 4)))
|
||||
item-width 16
|
||||
offset-x (+ x (/ item-width 2))
|
||||
offset-y (+ y (/ item-width 2))
|
||||
padding (/ item-width 2)
|
||||
padding (* 4 padding)]]
|
||||
(assoc (texture (aget (:all-items entities) 0 (.indexOf utils/+all-cursors+ (:cursor item))))
|
||||
:x x :y y
|
||||
:scale-x 4
|
||||
:scale-y 4
|
||||
:origin-x 0
|
||||
:origin-y 0
|
||||
:item item
|
||||
:box (zone/box (- offset-x padding) (- offset-y padding) (+ offset-x item-width padding padding) (+ offset-y item-width padding padding)))))
|
||||
(assoc-in [:tweens :fade-in] (tween/tween :fade-in screen [:opacity] 0.0 1.0 0.2 :ease tween/ease-out-cubic)))))
|
||||
|
||||
:on-mouse-moved (fn [screen [entities]]
|
||||
(let [[x y] (utils/unproject screen)
|
||||
@@ -90,7 +103,7 @@
|
||||
(assoc entities :highlighted-item nil))))
|
||||
|
||||
:on-touch-up (fn [screen [entities]]
|
||||
(when (and (:shown? entities) (= (button-code :left) (:button screen)))
|
||||
(when (and (:shown? entities) (= (button-code :left) (:button screen)) (= 1.0 (:opacity entities)))
|
||||
(let [{:keys [highlighted-item]} entities
|
||||
room-entities (-> @(resolve 'advent.screens.scene/scene)
|
||||
:entities
|
||||
@@ -102,8 +115,8 @@
|
||||
(screen! @(resolve 'advent.screens.scene/scene) :on-chose-item :item highlighted-item)
|
||||
(when-let [interaction-script ((or (:scripts highlighted-item) (constantly nil)) (:value current-cursor))]
|
||||
(interaction-script room-entities)
|
||||
(close entities)))
|
||||
(close entities)))))
|
||||
(close screen entities)))
|
||||
(close screen entities)))))
|
||||
|
||||
:on-resize (fn [screen entities]
|
||||
(.update (:viewport screen) (:width screen) (:height screen) true)))
|
||||
|
||||
@@ -31,13 +31,13 @@
|
||||
(defn present-frankie-choices [entities]
|
||||
(actions/present-choices entities {:choices ["Please, Frankie. Give me my stuff back!"
|
||||
{:run #(do (actions/respond entities %
|
||||
:frankie "Not a chance, Faceplant."
|
||||
:frankie "Not a chance, Dipstick."
|
||||
:frankie "Burglers like us gotta eat too, you know."
|
||||
:ego "But it's a matter of life and death! Georgia McGorgeous is counting on me!"
|
||||
)
|
||||
(actions/in-love entities)
|
||||
(actions/respond entities %
|
||||
:frankie "Georgia's going steady with me now, Faceplant.")
|
||||
:frankie "Georgia's going steady with me now, Dipstick.")
|
||||
(actions/play-animation entities :frankie :laugh)
|
||||
(actions/do-dialogue entities :frankie "You'd be better off if you just packed your bags and left town."
|
||||
:frankie "Ain't that right boys?")
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
"You guys are nothing but a bunch of crooks!"
|
||||
{:run #(do (actions/respond entities %
|
||||
:frankie "Oh please, Faceplant."
|
||||
:frankie "Oh please."
|
||||
:frankie "Like you're so different."
|
||||
:frankie "Am I right boys?")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
@@ -57,7 +57,7 @@
|
||||
:choices actions/previous-choices}
|
||||
|
||||
"Where is your secret stash?"
|
||||
{:run #(do (actions/respond entities % :frankie "Like I'd ever tell you, Faceplant.")
|
||||
{:run #(do (actions/respond entities % :frankie "Like I'd ever tell you, Dipstick.")
|
||||
(actions/play-animation entities :frankie :laugh)
|
||||
(actions/do-dialogue entities :frankie "That's only for people in the 'Super secret cool club'!"))
|
||||
:choices actions/previous-choices}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
|
||||
(defn listen-1 [entities]
|
||||
(actions/talk entities :ego "Did you see the look on Faceplant's face when we took his stuff?" :animate? false :stop? false)
|
||||
(actions/talk entities :ego "Did you see the look on Tick's face when we took his stuff?" :animate? false :stop? false)
|
||||
(actions/talk entities :ego "It looked like he was about to pee his pants." :animate? false :stop? false)
|
||||
(actions/talk entities :ego "Am I right boys?" :animate? false :stop? false))
|
||||
|
||||
|
||||
@@ -53,26 +53,32 @@
|
||||
{:run #(actions/respond entities %
|
||||
:game-player "Thanks. I'm the reigning champ in the annual Town of Remington Junior Smarty Pants Derby."
|
||||
:game-player "I earned it with my wisdom and sharp intellect."
|
||||
:game-player "Oh, I'm guessing you want it? Maybe to prove your wisdom and pull the Sword of Blergh?"
|
||||
:game-player "Oh, I'm guessing you want it? "
|
||||
:game-player "Maybe to prove your wisdom and pull the Sword of Blergh?"
|
||||
:game-player "Perhaps to become a knight and impress a young lady?")
|
||||
:choices ["Yes."
|
||||
{:run #(actions/respond entities %
|
||||
:game-player "My trophy is hard-won. You won't pry it from my fingers easily."
|
||||
:game-player "But I'm preparing for next year's Junior Smarty Pants Derby, and I need some help."
|
||||
:game-player "If you can help me, it will secure my success for next year, and so you can have this trophy."
|
||||
:game-player "My trophy is hard-won."
|
||||
:game-player "You won't pry it from my fingers easily."
|
||||
:game-player "But I am preparing for next year's Junior Smarty Pants Derby..."
|
||||
:game-player "... and I could use some help."
|
||||
:game-player "If you can help me, it will secure my success next year."
|
||||
:game-player "And I'll give you my trophy in exchange."
|
||||
:game-player "Deal?")
|
||||
:choices ["What is the Junior Smarty Pants Derby?"
|
||||
{:run #(actions/respond entities %
|
||||
:game-player "The annual Town of Remington Junior Smarty Pants Derby is a contest of wits."
|
||||
:game-player "It's sort of like a game of riddles, mixed with a scavenger hunt."
|
||||
:game-player "You must find the answer to the riddle to win."
|
||||
:game-player "There are a few puzzles that even I, Brian O'Brainy, stumped."
|
||||
:game-player "If you can help me, I'll let you have my trophy.")
|
||||
:game-player "There are a few riddles that even I, the wise Brian O'Brainy, can't solve."
|
||||
:game-player "That's where you come in.")
|
||||
:choices actions/previous-choices}
|
||||
"Deal."
|
||||
{:run #(do (actions/update-state entities (fn [state] (assoc state :current-riddle :wool)))
|
||||
(actions/respond entities %
|
||||
:game-player "Very well. I am studying for next year's derby, and there are a few puzzles that have me stumped."
|
||||
:game-player "Very well. "
|
||||
:game-player "I'm studying for next year's derby..."
|
||||
:game-player "... and there are a few puzzles that have ME stumped."
|
||||
:game-player "If you can bring me the answers to three riddles, I'll give you my trophy."
|
||||
:game-player "Here's the first riddle:"
|
||||
:game-player "'White as snow, but not as cold,\nKeeps you warm, or so I'm told.'"
|
||||
@@ -87,19 +93,21 @@
|
||||
|
||||
(defn do-game-player-dialogue [entities]
|
||||
(walk-to-player entities)
|
||||
(actions/do-dialogue entities :ego "You there!" :game-player "... Yes?")
|
||||
(actions/do-dialogue entities :ego "You there!"
|
||||
:game-player "... Oh, hello Tick. "
|
||||
:game-player "What is it?")
|
||||
(actions/present-choices entities
|
||||
{:choices ["Do you know anything about the sword in the stone up there?"
|
||||
{:run #(actions/respond entities %
|
||||
:game-player "It's the Sword of Blergh. There's a prophecy that says that whoever pulls it will be a great knight!"
|
||||
:game-player "It's the Sword of Blergh. "
|
||||
:game-player "There's a prophecy that says that whoever pulls it will be a great knight!"
|
||||
:game-player "'The Sword of Blergh, with magic sting,\nshall yield to no earthly king.'"
|
||||
:game-player "'Worthy in wisdom, courage, and might,\nonly then with sword he'll fight.'"
|
||||
:game-player "I've often dreamed of pulling the sword myself.")
|
||||
:choices ["Why don't you?"
|
||||
{:run #(do (actions/respond entities %
|
||||
:game-player "I, of course, have the wisdom to do such a deed."
|
||||
:game-player "I, of course, am the wisest in all of Remington."
|
||||
:game-player "But I'm not much of a hero."
|
||||
:game-player "I don't have the might or courage required to pull the sword and fulfill the prophecy. "
|
||||
:game-player "The knights of Remington have muscles the size of tree trunks."
|
||||
:game-player "But me...")
|
||||
(sound! (sound "inside-castle/flex.ogg") :play (utils/current-sound-volume))
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
:frankie "And how about that? A glass eye."
|
||||
:frankie "And not only that, it's the choicest of glass eyes!"
|
||||
:frankie "It must be made of the choicest glass, from across the sea!"
|
||||
:frankie "This'll be perfect for when I punch your eye out Faceplant."
|
||||
:frankie "This'll be perfect for when I punch your eye out, Dipstick."
|
||||
:frankie "Or, I could fetch some real good dough for this."
|
||||
:frankie "What would you say boys?")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
@@ -144,7 +144,7 @@
|
||||
(actions/do-dialogue entities
|
||||
:frankie "And how about that? Some used earplugs."
|
||||
:frankie "Wow! These are the choicest of earplugs!"
|
||||
:frankie "They're great for tuning out your voice, Faceplant!"
|
||||
:frankie "They're great for tuning out your voice, Dipstick!"
|
||||
:frankie "But, I could fetch some real good dough for them."
|
||||
:frankie "What would you say boys? ")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
@@ -154,7 +154,7 @@
|
||||
(actions/do-dialogue entities
|
||||
:frankie "And how about that? Some used earplugs."
|
||||
:frankie "Wow! These are the choicest of earplugs!"
|
||||
:frankie "They're great for tuning out your voice, Faceplant!"
|
||||
:frankie "They're great for tuning out your voice, Dipstick!"
|
||||
:frankie "But, I could fetch some real good dough for them."
|
||||
:frankie "What would you say boys? ")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
@@ -167,23 +167,24 @@
|
||||
(do
|
||||
(actions/do-dialogue entities
|
||||
:frankie "Well, well, well. What have we here boys?"
|
||||
:frankie "It's good ol' Faceplant again.")
|
||||
:frankie "It's good ol' Dipstick again.")
|
||||
(actions/play-animation entities :frankie :laugh))
|
||||
(do
|
||||
(actions/do-dialogue entities :frankie "Well, well, well. What have we here boys?")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
(actions/do-dialogue entities :frankie "It's good ol' Faceplant.")
|
||||
(actions/do-dialogue entities :frankie "It's good ol' Dipstick.")
|
||||
(actions/play-animation entities :frankie :laugh)
|
||||
(actions/do-dialogue entities
|
||||
:ego "Uh, oh. Frankie Rockfist!"
|
||||
:ego "Listen, I don't want any trouble."
|
||||
:frankie "Well you found it tonight, Faceplant."
|
||||
:frankie "Well you found it tonight, Dipstick."
|
||||
:frankie "Am I right boys?")
|
||||
(actions/play-animation entities :frankie :glance)
|
||||
(actions/do-dialogue entities :frankie "You looking for another beat down Faceplant?")
|
||||
(actions/do-dialogue entities :frankie "You looking for another beat down Dipstick?")
|
||||
(actions/play-animation entities :frankie :laugh)
|
||||
(actions/do-dialogue entities
|
||||
:ego "I'm just passing through..."
|
||||
:ego "The name's \"Tick\"..."
|
||||
:ego "... and I'm just passing through..."
|
||||
:frankie "Not tonight you're not."
|
||||
:frankie "Unless, of course, you can pay the toll."
|
||||
:frankie "Come here, faceplant."
|
||||
@@ -192,7 +193,7 @@
|
||||
:frankie "Now.")
|
||||
(actions/walk-straight-to entities :ego [254 80])
|
||||
(actions/do-dialogue entities
|
||||
:frankie "Now what have we got to give us today, Faceplant?"
|
||||
:frankie "Now what have we got to give us today, Dipstick?"
|
||||
:frankie "A strength potion, oh very nice!"
|
||||
:frankie "And some gold..."
|
||||
:frankie "And what's this?"
|
||||
@@ -202,9 +203,9 @@
|
||||
(frankie-comment-on-item entities)
|
||||
(actions/give entities :money)
|
||||
(actions/do-dialogue entities
|
||||
:frankie "Here's a little tip for your troubles, Faceplant."
|
||||
:frankie "Here's a little tip for your troubles, Dipstick."
|
||||
:frankie "Bubba, put this stuff in the secret stash."
|
||||
:frankie "Now move along, Faceplant."
|
||||
:frankie "Now move along."
|
||||
:frankie "Before we decide to take all of your stuff."
|
||||
:ego "But I need that slingshot!"
|
||||
:frankie "Too bad. Move along.")
|
||||
|
||||
@@ -468,7 +468,7 @@
|
||||
:wizard (rooms/make-entity :wizard (common/make-wizard screen {:x 190 :y 78 :baseline 162 :scale-x 1.2 :scale-y 1.2
|
||||
:script (actions/get-script entities (talk-to-gandarf-outside entities))}))
|
||||
:note (rooms/make-entity :note (assoc (texture "outsidehouse/note.png")
|
||||
:x 286 :y 80 :baseline 160
|
||||
:x 277 :y 74 :baseline 160
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [280 80] :face :right)
|
||||
(actions/play-animation entities :ego :squat)
|
||||
|
||||
@@ -130,22 +130,24 @@
|
||||
))}
|
||||
:stump {:box [205 68 251 89]
|
||||
:script (actions/get-script entities
|
||||
(actions/do-dialogue entities :ego "It's a stump."))
|
||||
(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/play-animation entities :ego :axe-wood)
|
||||
(actions/walk-straight-to entities :ego [170 71]))
|
||||
:scripts {:alarm-clock (actions/get-script entities
|
||||
(actions/walk-to entities :ego [189 65] :face :right)
|
||||
(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-item entities :alarm-clock)
|
||||
(actions/add-entity entities :alarm-clock (get-in @entities [:room :alarm-clock])))
|
||||
:sword (actions/get-script entities
|
||||
(when (get-in @entities [:room :entities :alarm-clock])
|
||||
(actions/walk-to entities :ego [129 65] :face :right)
|
||||
(actions/talk entities :ego "I'll take a big swing!")
|
||||
(actions/walk-straight-to entities :ego [189 65] :face :right :speed 3.5)
|
||||
(actions/play-animation entities :ego :swing)
|
||||
(actions/talk entities :ego "It's split right down the middle!")
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/remove-entity entities :alarm-clock)
|
||||
(actions/give entities :broken-clock)))}}
|
||||
(actions/add-entity entities :alarm-clock (get-in @entities [:room :alarm-clock]))
|
||||
(actions/play-animation entities :ego :axe)
|
||||
(actions/talk entities :ego "It's split right down the middle!")
|
||||
(actions/play-animation entities :ego :reach)
|
||||
(actions/remove-entity entities :alarm-clock)
|
||||
(actions/give entities :broken-clock)
|
||||
(actions/walk-straight-to entities :ego [170 71]))
|
||||
:sword (actions/get-script entities (actions/talk entities :ego "I can just use the axe."))}}
|
||||
:lever {:box [10 72 17 85]
|
||||
:script (actions/get-script entities
|
||||
(interact-with-lever entities))
|
||||
|
||||
@@ -54,27 +54,20 @@
|
||||
(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)
|
||||
(-> entities
|
||||
(assoc :start-showing? false)
|
||||
(assoc :shown? true))
|
||||
entities)]
|
||||
|
||||
(when (:shown? entities)
|
||||
(render! screen [(:fade entities) (:safe entities)])
|
||||
(render! screen (take (count (:button-choices entities)) (:entered-keys entities))))
|
||||
entities))
|
||||
(when (:shown? 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]]
|
||||
(sound! (sound "inside-house/open-safe.ogg") :play (utils/current-sound-volume))
|
||||
(assoc entities
|
||||
:start-showing? true
|
||||
:shown? true
|
||||
:button-choices []
|
||||
:success success
|
||||
:failure failure))
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
[advent.utils :as utils]
|
||||
[advent.tween :as tween]
|
||||
[advent.screens.rooms :as rooms]
|
||||
[advent.screens.fade :refer [fade-screen]]
|
||||
[advent.screens.items :as items]
|
||||
[advent.screens.rooms.dream :as rooms.dream]
|
||||
[advent.screens.rooms.castle-gate :as rooms.castle-gate]
|
||||
@@ -209,6 +210,8 @@
|
||||
throw (utils/make-anim "ego/throw.png" [18 36] 0.04 (flatten [[(repeat 5 0) (repeat 10 1)] (repeat 3 [2 2 2 3 3 3 4 4 4 5 5 5]) (repeat 5 [2 2 3 3 4 4 5 5]) (repeat 10 [2 3 4 5]) [2 3 3] (repeat 15 6)]))
|
||||
swing-shovel (utils/make-anim "ego/swing-shovel.png" [70 70] 0.1 (range 9))
|
||||
love (utils/make-anim "ego/love.png" [50 70] 0.1 (flatten [0 0 1 1 2 2 3 3 4 4 5 5 6 6 (repeat 10 7) (repeat 5 8) (repeat 5 7) (repeat 5 8) (repeat 5 7) (repeat 10 [23 24 25 24]) (repeat 30 9) 10 11 12 13 14 15 16 17 18 19 20 21 21 21 22 22 22 21 21 21 21 21 21 21 21 22 22 22 22 22 21 21 21 21 22 22 22 22 22 22 21 21 21 21 21 6 6 5 5 4 4 3 3 2 2 1 1 0]))
|
||||
axe (utils/make-anim "ego/axe.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 7)]))
|
||||
axe-wood (utils/make-anim "ego/axe-wood.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 11)]))
|
||||
|
||||
ego {:right {:walk walk-right
|
||||
:stand stand-anim
|
||||
@@ -251,6 +254,8 @@
|
||||
:swing-shovel swing-shovel
|
||||
:love love
|
||||
:idea idea
|
||||
:axe axe
|
||||
:axe-wood axe-wood
|
||||
}
|
||||
:left {:walk (utils/flip walk-right)
|
||||
:stand (utils/flip stand-anim)
|
||||
@@ -283,7 +288,9 @@
|
||||
:throw (utils/flip throw)
|
||||
:swing-shovel (utils/flip swing-shovel)
|
||||
:love (utils/flip love)
|
||||
:idea (utils/flip idea)}
|
||||
:idea (utils/flip idea)
|
||||
:axe (utils/flip axe)
|
||||
:axe-wood (utils/flip axe-wood)}
|
||||
:baseline (- 240 (last start-pos))
|
||||
:facing :right
|
||||
:origin-x 9
|
||||
@@ -370,6 +377,8 @@
|
||||
:anim-merges {(get-in ego [:right :shock]) {:origin-x 15}
|
||||
(get-in ego [:left :swing-shovel]) {:origin-x 26}
|
||||
(get-in ego [:right :swing-shovel]) {:origin-x 26}
|
||||
(get-in ego [:right :axe]) {:origin-x 17}
|
||||
(get-in ego [:right :axe-wood]) {:origin-x 17}
|
||||
(get-in ego [:left :love]) {:origin-x 36}
|
||||
:default {:origin-x 9}})]
|
||||
(actions/start-animation screen
|
||||
@@ -588,13 +597,8 @@
|
||||
|
||||
:sounds {:blink (sound "blink-other.ogg")
|
||||
:object nil}
|
||||
:fade (assoc (texture "black.png")
|
||||
:scale-x 20
|
||||
:scale-y 20
|
||||
:baseline 9500
|
||||
:opacity 0.0
|
||||
:origin-x 0
|
||||
:origin-y 0)
|
||||
:fade {:object nil
|
||||
:opacity 0.0}
|
||||
:white-fade (assoc (texture "white.png")
|
||||
:scale-x 20
|
||||
:scale-y 20
|
||||
@@ -689,6 +693,7 @@
|
||||
|
||||
all-entities (concat (vals entities) layers (vals (get-in entities [:room :entities])))]
|
||||
(screen! talking-screen :on-update-camera :scene-viewport (:viewport screen) :scene-camera (:camera screen))
|
||||
(screen! fade-screen :update-fade :opacity (get-in entities [:fade :opacity]))
|
||||
(when true #_(not (get-in entities [:cam :paused?]))
|
||||
(set! (. camera zoom) (:zoom (:cam entities)))
|
||||
(set! (.. camera position x) (:x (:cam entities) 160.0))
|
||||
@@ -753,16 +758,17 @@
|
||||
:on-show-inventory (fn [screen [entities]]
|
||||
(click-inventory screen entities))
|
||||
:on-menu (fn [screen [entities]]
|
||||
(-> entities
|
||||
(assoc-in [:cursor :override] nil)
|
||||
(assoc-in [:tweens :fade-out-music]
|
||||
(tween/tween :fade-out-music screen [:volume :value] 1.0 0.0 1.0))
|
||||
(assoc-in [:tweens :fade-out]
|
||||
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
|
||||
:finish #(do (.clear @(resolve 'advent.core/am))
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
(set-screen! @(resolve 'advent.core/advent) @(resolve 'advent.screens.title/title-screen))
|
||||
%)))))
|
||||
(when-not (get-in entities [:tweens :fade-out])
|
||||
(-> entities
|
||||
(assoc-in [:cursor :override] nil)
|
||||
(assoc-in [:tweens :fade-out-music]
|
||||
(tween/tween :fade-out-music screen [:volume :value] 1.0 0.0 1.0))
|
||||
(assoc-in [:tweens :fade-out]
|
||||
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
|
||||
:finish #(do (.clear @(resolve 'advent.core/am))
|
||||
(input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
(set-screen! @(resolve 'advent.core/advent) @(resolve 'advent.screens.title/title-screen))
|
||||
%))))))
|
||||
|
||||
:on-start-script (fn [{:keys [script]} [entities]]
|
||||
(script entities)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
[advent.screens.title :as title]
|
||||
[advent.screens.inventory :as inventory]
|
||||
[advent.screens.safe :as safe]
|
||||
[advent.screens.fade :as fade]
|
||||
)
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
@@ -68,7 +69,6 @@
|
||||
:font font
|
||||
:music music
|
||||
:volume 1.0
|
||||
:start-showing? false
|
||||
:start-playing start-playing
|
||||
:quit quit
|
||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0
|
||||
@@ -111,7 +111,7 @@
|
||||
(tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0
|
||||
:finish (fn [entities]
|
||||
(utils/stop-sound (:music entities))
|
||||
(set-screen! @(resolve 'advent.core/advent) scene/scene scene/hud dialogue/talking-screen dialogue/choice-screen inventory/inventory-screen safe/safe-screen)
|
||||
(set-screen! @(resolve 'advent.core/advent) scene/scene scene/hud dialogue/talking-screen dialogue/choice-screen inventory/inventory-screen safe/safe-screen fade/fade-screen)
|
||||
entities)
|
||||
:ease tween/ease-in-cubic))
|
||||
(assoc-in [:tweens :fade-out-music]
|
||||
|
||||
Reference in New Issue
Block a user