cafeteria too.

This commit is contained in:
Bryce Covert
2017-05-28 17:49:46 -07:00
parent 2fb45ffc28
commit 645ee8cc26
16 changed files with 115 additions and 194 deletions

View File

@@ -11,8 +11,8 @@
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all]))
(defn make-fight-entity []
(assoc (utils/get-texture "black.png")
(defn make-fight-entity [global-atlas]
(assoc (utils/atlas->texture global-atlas "black.png")
:x 0
:y 0
:scale-x 21
@@ -172,21 +172,19 @@
(mapcat #(repeat (- 4 speed) %) xs))
(defn make [screen]
(let [#_#_warriors-stand-sheet (texture! (utils/get-texture "inside-cafeteria/warriors-stand.png") :split 66 126)
#_#_warriors-stand (animation 0.2 (for [i [0 0 0 0 0 0 1 1 0 0 1 1 1 0 0 2 2 2 2 3 3 3 0 0 0 2 2 2 ]]
(aget warriors-stand-sheet 0 i)))
#_#_ladder-guard-sheet (texture! (utils/get-texture "inside-cafeteria/ladder-guard.png") :split 37 87)
#_#_ladder-guard-stand (animation 0.1 [(aget ladder-guard-sheet 0 0)])
ladder-guard-stand (animation 0.1 [(utils/get-texture "inside-cafeteria/ladder-guard-2.png")])
ladder-guard-talk (animation 0.1 [ (utils/get-texture "inside-cafeteria/ladder-guard-2.png")])
warriors-stand (utils/make-anim "inside-cafeteria/knights-stand.png" [49 80] 0.6 (take 100 (repeatedly #(rand-int 10))))
knight-a-stand (utils/make-anim "inside-cafeteria/knight-a.png" [70 85] 0.2 (flatten [(repeat 3 [(repeat 7 0) (repeat 7 1) (repeat 7 0) (repeat 7 2)]) [3 4 5 6 7 8 9]]))
(let [[screen atlas] (utils/acquire-atlas screen "packed/inside-cafeteria.atlas")
[screen global-atlas] (utils/acquire-atlas screen "packed/global.atlas")
ladder-guard-stand (animation 0.1 [(utils/atlas->texture atlas "ladder-guard-2")])
ladder-guard-talk (animation 0.1 [ (utils/atlas->texture atlas "ladder-guard-2")])
warriors-stand (utils/make-anim atlas "knights-stand" [49 80] 0.6 (take 100 (repeatedly #(rand-int 10))))
knight-a-stand (utils/make-anim atlas "knight-a" [70 85] 0.2 (flatten [(repeat 3 [(repeat 7 0) (repeat 7 1) (repeat 7 0) (repeat 7 2)]) [3 4 5 6 7 8 9]]))
#_#_ladder-guard-talk (animation 0.2 (for [i [0 0 0 0 1 0 0 1]]
(aget ladder-guard-sheet 0 i)))
hands-fight-win (utils/make-anim-seq "inside-cafeteria/fight-new-assets/fight" [256 192] 0.025 (flatten [(pace [0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 0 1 1 1 1 0 0 0 4 0 1 1 1 1 1 1 1 1 4 0 4 0 4 0 4 5 5 5 5 5 4 4 4] 0)
hands-fight-win (utils/make-anim-seq atlas "fight-new-assets/fight" [256 192] 0.025 (flatten [(pace [0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 1 0 4 0 0 1 1 1 1 0 0 0 4 0 1 1 1 1 1 1 1 1 4 0 4 0 4 0 4 5 5 5 5 5 4 4 4] 0)
(pace (flatten (repeat 6 [12 13])) 0)
(pace (flatten (repeat 15 [7 8])) 0)
(pace (flatten (repeat 15 [9])) 0)
@@ -202,7 +200,7 @@
(pace (flatten (repeat 6 [12 13])) 0)
(pace [0 0 0 0 2 1 1 2 2 1 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3] 0)]))
hands-fight-lose (utils/make-anim-seq "inside-cafeteria/fight-new-assets/fight" [256 192] 0.1 (flatten [4 4 4 4 4 4 0 0 0 0 4 4 4 0 0 0 5 5 5 6 6 6 6 6 6]))]
hands-fight-lose (utils/make-anim-seq atlas "fight-new-assets/fight" [256 192] 0.1 (flatten [4 4 4 4 4 4 0 0 0 0 4 4 4 0 0 0 5 5 5 6 6 6 6 6 6]))]
(rooms/make :music :town-1
:name "Cafeteria"
:interactions
@@ -214,10 +212,10 @@
(actions/walk-to entities :ego [126 80] :skip-type :end))
:cursor :right}
}
:layers [(assoc (utils/get-texture "inside-cafeteria/background.png") :x 0 :y 0 :baseline 0)
(assoc (utils/get-texture "inside-cafeteria/doorway.png") :x 306 :y 34 :baseline 202)
(assoc (utils/get-texture "inside-cafeteria/glow.png") :y 0 :baseline 240 :additive? true :opacity 0.3)
(assoc (utils/get-texture "inside-cafeteria/fg.png") :x 10 :y 0 :scale-x 1.1 :scale-y 1.0 :baseline 320 :parallax 1.5)
:layers [(assoc (utils/atlas->texture atlas "background") :x 0 :y 0 :baseline 0)
(assoc (utils/atlas->texture atlas "doorway") :x 306 :y 34 :baseline 202)
(assoc (utils/atlas->texture atlas "glow") :y 0 :baseline 240 :additive? true :opacity 0.3)
(assoc (utils/atlas->texture atlas "fg") :x 10 :y 0 :scale-x 1.1 :scale-y 1.0 :baseline 320 :parallax 1.5)
]
:entities {:warriors (actions/start-animation screen (assoc (animation->texture screen warriors-stand) :x 31 :y 36 :baseline 180
@@ -265,13 +263,13 @@
"Do not durst telleth a soul about that ladder!"
"No thank you, young sire."))))
:stand)
:ladder (assoc (utils/get-texture "inside-cafeteria/ladder.png") :x 205 :y 70 :baseline 170
:ladder (assoc (utils/atlas->texture atlas "ladder") :x 205 :y 70 :baseline 170
:cursor :hand
:label "Ladder"
:script (actions/get-script entities
(actions/talk entities :ladder-guard "Do not toucheth, young sire.")))}
:collision "inside-cafeteria/collision.png"
:fight (make-fight-entity)
:fight (make-fight-entity global-atlas)
:hands-fight (assoc (animation->texture screen hands-fight-win)
:origin-x 128
:origin-y 96