working on ios.

This commit is contained in:
Bryce Covert
2015-09-12 23:11:18 -07:00
parent 0ca5dc3fc5
commit 43152747bc
16 changed files with 49 additions and 42 deletions

View File

@@ -533,7 +533,7 @@
(defn give [entities item]
(run-action entities
(begin [this screen entities]
(sound! (sound "pickup.mp3") :play (utils/current-sound-volume))
(sound! (utils/load-sound "pickup.mp3") :play (utils/current-sound-volume))
(-> entities
(update-in [:state :inventory] #(conj % item))

View File

@@ -313,7 +313,7 @@
(if (get-in @entities [:room :entities :ladder])
(do (actions/talk entities :ego "I think he's going for it!")
(actions/play-animation entities :ego :cat-toy-first-half :stop? false)
(sound! (sound "cat-tree/cat.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "cat-tree/cat.ogg") :play (utils/current-sound-volume))
(actions/walk-straight-to entities :cat [138 40] :update-baseline? false :speed 3)
(actions/play-animation entities :ego :cat-toy-last-half)
(actions/play-animation entities :grandma :squat-1 :stop? false)
@@ -328,7 +328,7 @@
:grandma "Come here young man.")
(actions/walk-straight-to entities :ego [133 35])
(actions/talk entities :grandma "For your impressive display of courage and bravery, I give you this. ")
(sound! (sound "cat-tree/kiss.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "cat-tree/kiss.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :grandma :kiss)
(actions/play-animation entities :ego :get-sick :stop? false)
(actions/walk-straight-to entities :ego [165 45])

View File

@@ -178,7 +178,7 @@
"Show yourself!"
{:run #(actions/talk entities :ego %)}]})
(actions/talk entities :fairy-godfather "Taaaaaaaaaaaaaaaaaa-")
(sound! (sound "dream/appear.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "dream/appear.ogg") :play (utils/current-sound-volume))
(particle-effect! (get-in @entities [:room :entities :magic]) :reset)
(particle-effect! (get-in @entities [:room :entities :magic]) :start)
(fade-in entities)
@@ -197,7 +197,7 @@
:fairy-godfather "Behold!")
(particle-effect! (get-in @entities [:room :entities :magic]) :reset)
(particle-effect! (get-in @entities [:room :entities :magic]) :start)
(sound! (sound "dream/appear.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "dream/appear.ogg") :play (utils/current-sound-volume))
(fade-in-tools entities)
(Thread/sleep 2500)
@@ -374,7 +374,7 @@
(assoc (utils/get-texture "dream/corner-l.png") :x -10 :y -10 :baseline 240 :parallax 2.0 )
(assoc (utils/get-texture "dream/corner-r.png") :x (- 320 80) :y -20 :baseline 240 :parallax 3.2)
(assoc (utils/get-texture "dream/pedestals.png") :x 0 :y 0 :baseline 139)]
:wind-sound {:sound (sound "dream/wind.ogg")
:wind-sound {:sound (utils/load-sound "dream/wind.ogg")
:id nil}
:entities {:magic (assoc (particle-effect "particles/dream-magic") :x 160 :y 80 :baseline 240)

View File

@@ -335,7 +335,7 @@
(actions/talk entities :ego "I'll just try another one of these mints."))
(actions/play-animation entities :ego :reach)
(actions/update-state entities (fn [s] (assoc s :mints-eaten (inc (s :mints-eaten)))))
(sound! (sound (str "inside-antique/fire-" (get-in @entities [:state :mints-eaten]) ".ogg")) :play (utils/current-sound-volume))
(sound! (utils/load-sound (str "inside-antique/fire-" (get-in @entities [:state :mints-eaten]) ".ogg")) :play (utils/current-sound-volume))
(cond
(= 2 (get-in @entities [:state :mints-eaten]))
(do (particle-effect! (get-in @entities [:room :entities :smoke-particle]) :reset)

View File

@@ -73,7 +73,7 @@
(if (actions/has-item? @entities :flask-1-strength)
(do
(actions/do-dialogue entities :ego "One sec.")
(sound! (sound "ego/potion.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "ego/potion.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :ego :grow :stop? false)
(play-battle entities :win)
(actions/do-dialogue entities

View File

@@ -54,7 +54,7 @@
(begin [this screen entities]
(particle-effect! (get-in entities [:room :entities :appear]) :reset)
(particle-effect! (get-in entities [:room :entities :appear]) :start)
(sound! (sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(-> entities
(assoc-in [:tweens :bloodclot-head-appear]
(tween/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 0.0 1.0 1.0 :ease tween/ease-in-quadratic))
@@ -208,7 +208,7 @@
:game-player "But I'm not much of a hero."
: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))
(sound! (utils/load-sound "inside-castle/flex.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :game-player :flex)
(actions/do-dialogue entities :game-player "I'd never be able to prove my strength."))
:choices actions/previous-choices}
@@ -621,7 +621,7 @@
(actions/give entities :monocle)
(actions/talk entities :ego "It looks like a monocle."))}))
:chorus {:sound (sound "inside-castle/chorus.ogg")}
:chorus {:sound (utils/load-sound "inside-castle/chorus.ogg")}
:collision "inside-castle/collision.png"
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [_ entities]

View File

@@ -123,7 +123,7 @@
:wizard "Ok, I'll deliver some more myself. Don't touch anything while I'm gone.")
(actions/update-state entities (fn [s] (assoc s :mints-eaten 0
:wizard-left? true)))
(sound! (sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :wizard :disappear :stop? false)
(actions/remove-entity entities :wizard))}
"Nevermind."

View File

@@ -340,8 +340,8 @@
:anim warden-stand
:anim-start 0
:night-profile :none
:inhale (sound "inside-jail/inhale.ogg")
:exhale (sound "inside-jail/exhale.ogg")
:inhale (utils/load-sound "inside-jail/inhale.ogg")
:exhale (utils/load-sound "inside-jail/exhale.ogg")
:talk-color (color 0.9 0.3 0.9 1.0)
:anim-sound-frames {warden-stand {31 [:blink 0.15]
51 [:blink 0.15]}

View File

@@ -320,7 +320,7 @@
(actions/play-animation entities :ego :squat)
(actions/talk entities :ego "No one will notice one missing.")
(actions/give entities :carrot))))}}
:flies-sound {:sound (sound "outside-castle/flies2.ogg")
:flies-sound {:sound (utils/load-sound "outside-castle/flies2.ogg")
:id nil}
:layers {:day [(assoc (utils/get-texture "outside-castle/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "outside-castle/blanket.png") :x 60 :y (- 240 173) :baseline 1)
@@ -336,7 +336,7 @@
(assoc (utils/get-texture "outside-castle/peddler.png") :x 110 :y 90 :baseline 150 :anim nil
:anim-sound-frames {peddler-stand {23 [:scratch 1.0]}
peddler-talk {23 [:scratch 1.0]}}
:scratch (sound "outside-castle/scratch.ogg")
:scratch (utils/load-sound "outside-castle/scratch.ogg")
:talk peddler-talk :stand peddler-stand
:talk-color (color 1.0 0.9 0.4 1.0)
:script (actions/get-script

View File

@@ -716,7 +716,7 @@
:door (assoc (animation->texture screen door)
:x 253 :y 88 :baseline 122
:open door
:door-sound (sound "door.ogg")
:door-sound (utils/load-sound "door.ogg")
:anim-sound-frames {door {1 [:door-sound 1.0]}}
)
:lamb (assoc (utils/get-texture "outsidehouse/lamb.png")

View File

@@ -244,7 +244,7 @@
:bent-bar-window (assoc (utils/get-texture "outside-jail/bent-bar-window.png")
:x 69 :y (- 240 63) :baseline 2)
:outside-particles (common/make-outside-particles)}
:fountain-sound {:sound (sound "outside-jail/fountain-2.ogg")
:fountain-sound {:sound (utils/load-sound "outside-jail/fountain-2.ogg")
:id nil}

View File

@@ -34,7 +34,7 @@
(not (get-in entities [:state :blergh-dead?]))
(actions/has-item? entities :magic-slingshot))
((actions/get-script entities
(sound! (sound "space/shock.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "space/shock.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :bloodclot-head :shoot :stop? false)
(actions/begin-animation entities :bloodclot-head :keep-shoot)
(actions/do-dialogue entities :bloodclot-head "Dang! Come a little closer!"))
@@ -58,7 +58,7 @@
(begin [this screen entities]
(particle-effect! (get-in entities [:room :entities :appear]) :reset)
(particle-effect! (get-in entities [:room :entities :appear]) :start)
(sound! (sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "inside-house/disappear.ogg") :play (utils/current-sound-volume))
(-> entities
(assoc-in [:tweens :bloodclot-head-appear]
(tween/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic))
@@ -87,7 +87,7 @@
(actions/run-action entities
(begin [this screen entities]
(sound! (sound "space/jump.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "space/jump.ogg") :play (utils/current-sound-volume))
(-> entities
(assoc-in [:room :entities :cloud] (assoc (utils/get-texture "space/cloud.png")
:x (- (get-in entities [:room :entities :ego :x]) 10)
@@ -134,7 +134,7 @@
(actions/run-action entities
(begin [this screen entities]
(sound! (sound "space/swingsword.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "space/swingsword.ogg") :play (utils/current-sound-volume))
(-> entities
(update-in [:room :entities :ego]
#(actions/start-animation screen % :swing))
@@ -243,7 +243,7 @@
(actions/do-dialogue entities :bloodclot-head "Ha ha ha! Is that the best you can do?"
:bloodclot-head "Take this!")
(sound! (sound "space/shock.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "space/shock.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :bloodclot-head :shoot :stop? false)
(actions/begin-animation entities :bloodclot-head :keep-shoot)
(actions/play-animation entities :ego :shock :stop? false)

View File

@@ -32,11 +32,11 @@
(first (filter (fn [{:keys [in?] :as button}]
(when (in? x y)
button))
[{:in? (button-box 9 17) :sound (sound "inside-house/safe-1.ogg") :id 1 }
{:in? (button-box 29 17) :sound (sound "inside-house/safe-2.ogg") :id 2}
{:in? (button-box 49 17) :sound (sound "inside-house/safe-3.ogg") :id 3}
{:in? (button-box 70 17) :sound (sound "inside-house/safe-4.ogg") :id 4}
{:in? (button-box 91 17) :sound (sound "inside-house/safe-5.ogg") :id 5}])))
[{:in? (button-box 9 17) :sound (utils/load-sound "inside-house/safe-1.ogg") :id 1 }
{:in? (button-box 29 17) :sound (utils/load-sound "inside-house/safe-2.ogg") :id 2}
{:in? (button-box 49 17) :sound (utils/load-sound "inside-house/safe-3.ogg") :id 3}
{:in? (button-box 70 17) :sound (utils/load-sound "inside-house/safe-4.ogg") :id 4}
{:in? (button-box 91 17) :sound (utils/load-sound "inside-house/safe-5.ogg") :id 5}])))
(defscreen safe-screen
:on-show
@@ -67,7 +67,7 @@
entities)
:show-screen (fn [{:keys [success failure]} [entities]]
(sound! (sound "inside-house/open-safe.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "inside-house/open-safe.ogg") :play (utils/current-sound-volume))
(assoc entities
:shown? true
:button-choices []
@@ -103,7 +103,7 @@
(< y start-y)
(> y (+ start-y 75)))
(do
(sound! (sound "inside-house/close-safe.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "inside-house/close-safe.ogg") :play (utils/current-sound-volume))
(close entities)))))))
:on-resize (fn [{:keys [width height viewport]} entities]

View File

@@ -301,7 +301,7 @@ void main()
(get-in @entities [:room :entities :warden])
(do
(actions/talk entities :ego "I'll just take a sip!")
(sound! (sound "ego/potion.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "ego/potion.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :ego :grow :stop? false)
(actions/talk entities :warden "Huh? What was that?!")
(Thread/sleep 1000)
@@ -314,7 +314,7 @@ void main()
:else
(do
(actions/talk entities :ego "I'll just take a sip!")
(sound! (sound "ego/potion.ogg") :play (utils/current-sound-volume))
(sound! (utils/load-sound "ego/potion.ogg") :play (utils/current-sound-volume))
(actions/play-animation entities :ego :grow :stop? false))))
:recipe
@@ -677,13 +677,13 @@ void main()
:origin-x 9
:origin-y 0
:scaled true
:milk-sound (sound "outsidehouse/milk.ogg")
:step-sound-1 (sound "ego/step-1.ogg")
:step-sound-2 (sound "ego/step-2.ogg")
:sigh-sound (sound "ego/sigh.ogg")
:breakglass-sound (sound "ego/breakglass.ogg")
:idea-sound (sound "ego/idea.ogg")
:blink (sound "ego/blink2.ogg")
:milk-sound (utils/load-sound "outsidehouse/milk.ogg")
:step-sound-1 (utils/load-sound "ego/step-1.ogg")
:step-sound-2 (utils/load-sound "ego/step-2.ogg")
:sigh-sound (utils/load-sound "ego/sigh.ogg")
:breakglass-sound (utils/load-sound "ego/breakglass.ogg")
:idea-sound (utils/load-sound "ego/idea.ogg")
:blink (utils/load-sound "ego/blink2.ogg")
:scale-x start-scale
:scale-y start-scale
:talk-color (color 0.6 1.0 1.0 1.0)
@@ -996,7 +996,7 @@ void main()
:closing? {:object nil
:value false}
:sounds {:blink (sound "blink-other.ogg")
:sounds {:blink (utils/load-sound "blink-other.ogg")
:object nil}
:fade {:object nil
:opacity 0.0}

View File

@@ -225,7 +225,13 @@
(try
(doto (music r) (music! :set-looping true))
(catch Exception _
(doto (music (str/replace r #"\.ogg" ".mp3")) (music! :set-looping true)))))
(doto (music (str r ".mp3")) (music! :set-looping true)))))
(defn load-sound [f]
(try
(sound (str f ".mp3"))
(catch Exception _
(sound (str f ".mp3")))))

View File

@@ -16,6 +16,7 @@
"-libs" "libs/libObjectAL.a:libs/libgdx.a:libs/libgdx-box2d.a:libs/libgdx-bullet.a"
"-frameworks" "UIKit:OpenGLES:QuartzCore:CoreGraphics:OpenAL:AudioToolbox:AVFoundation"
"-resources" "../desktop/resources/**"]
:robovm-path "/Users/brycecovert/dev/robovm/robovm-1.7.0/"}
:robovm-path "/Users/brycecovert/dev/robovm/robovm-1.7.0/"
:versionn 1.1}
:aot :all
:main advent.core.IOSLauncher)