adding balloon

This commit is contained in:
Bryce Covert
2015-09-11 08:55:53 -07:00
parent 776f738265
commit 39d90f00c3
8 changed files with 39 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,22 @@
<?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>
</array>
</plist>

View File

@@ -1 +0,0 @@
brycecovert@brometheus.local.31618

View File

@@ -48,6 +48,16 @@
(def do-once (atom false))
(defn fly-balloon [screen entities]
(let [speed 0.03
pos-f (- (* (:total-time screen) speed) (int (* (:total-time screen) speed)))
v (vector-2 0 0)
a (catmull-rom-spline! (:path (:balloon entities)) :value-at v pos-f)]
(-> entities
(update-in [:balloon]
merge {:x (vector-2! v :x)
:y (vector-2! v :y)}))))
(defn fly-ego [screen entities]
(let [speed 0.07
pos-f (- (* (:total-time screen) speed) (int (* (:total-time screen) speed)))
@@ -89,6 +99,7 @@
quit (center quit)
music (utils/make-music "intro.ogg")
ui-skin (skin "ui/ui.json")
balloon (utils/make-anim "title/balloon.png" [15 30] 0.45 (range 4))
]
(label! start-playing :set-alignment Align/center)
(label! quit :set-alignment Align/center)
@@ -114,6 +125,9 @@
:path (catmull-rom-spline (map #(apply vector-2* %) [[-800 450] [1280 450] [2000 100] [0 100] [-800 300] [1280 300] [2000 450]]) true)
:x 450
:y 650)
:balloon (assoc (animation->texture (assoc screen :total-time 0.0) balloon) :x 100 :y 100 :scale-x 4 :scale-y 4
:anim balloon
:path (catmull-rom-spline (map #(apply vector-2* %) [[50 50] [70 100] [100 200] [151 206] [300 225] [480 300] [560 400] [650 440] [700 550] [750 600] [860 650] [950 700] [1030 800] [1280 960] [1300 1000] [-50 1000] [-50 -50]]) true))
:particle-clouds (assoc (particle-effect "title/particle-clouds" :reset :start) :x 640 :y 480 )
:ego-jet (assoc (particle-effect "ego/jet" :reset :start) :x 450 :y 650 )
:toolbox (center (assoc (nine-patch {:region (:object (texture "talk-bg-2.png")) :left 9 :top 9 :right 9 :bottom 9})
@@ -162,13 +176,15 @@
(clear!)
(let [entities (utils/apply-tweens screen entities (:tweens entities))
entities (fly-ego screen entities)
entities (fly-balloon screen entities)
entities (update-in entities [:balloon] merge (animation->texture screen (:anim (:balloon entities))))
]
(label! (:fullscreen entities) :set-text (if (.isFullscreen Gdx/graphics)
"Fullscreen"
"Windowed"))
(music! (:music entities) :set-volume (utils/current-music-volume (:volume entities)))
(render! screen [(:background entities) (:particle-clouds entities) (:cloud-background entities) (:ego-jet entities) (:flying-ego entities) (:logo entities) (:toolbox entities) (:start-playing entities) (:quit entities) (:fullscreen entities) (:music-label entities) (:music-volume-slider entities) (:sound-label entities) (:sound-volume-slider entities) (:copyright entities) (:fade entities) ])
(render! screen [(:background entities) (:particle-clouds entities) (:cloud-background entities) (:balloon entities) (:ego-jet entities) (:flying-ego entities) (:logo entities) (:toolbox entities) (:start-playing entities) (:quit entities) (:fullscreen entities) (:music-label entities) (:music-volume-slider entities) (:sound-label entities) (:sound-volume-slider entities) (:copyright entities) (:fade entities) ])
entities))
:show-screen (fn [entities]