Adding more of the nighttime puzzle.

This commit is contained in:
2014-12-28 12:23:03 -08:00
parent bc55fa4c28
commit 5debdd60dd
19 changed files with 182 additions and 92 deletions

View File

@@ -1,6 +1,7 @@
(ns advent.screens.rooms.inside-house
(:require [advent.screens.items :as items]
[advent.screens.rooms :as rooms]
[advent.screens.rooms.common :as common]
[advent.screens.safe :as safe]
[advent.actions :as actions]
[advent.utils :as utils]
@@ -101,13 +102,7 @@
{:run #(actions/do-dialogue entities :ego %)}]}))
(defn make [screen]
(let [wizard-sheet (texture! (texture "wizard/talk.png") :split 20 46)
wizard-stand (animation 0.2 (for [i (flatten [(repeat 10 0) 1])]
(aget wizard-sheet 0 i)))
wizard-disappear (utils/make-anim "wizard/disappear.png" [20 46] 0.075 (range 19))
wizard-talk (animation 0.2 (for [i [0 2 0 2 1 2 0 3 0 2 0 1 0 2]]
(aget wizard-sheet 0 i)))
safelock-sheet (texture! (texture "inside-house/safe-lock.png") :split 9 2)
(let [safelock-sheet (texture! (texture "inside-house/safe-lock.png") :split 9 2)
safe-lock (animation 0.1 (for [i (flatten [(repeat 20 0) 1 2 1 2 1 2 1 2 1 2 1 1 2 1 2 1 2 1 2 1 2 1 (range 3 20) 20 20 20 20 21 21 21 21 21 20 20 21 21 21 21 21 20 20 20 ])]
(aget safelock-sheet 0 i)))
candle (utils/make-anim (texture "inside-house/candle.png") [34 32] 0.2 [1 0 1 2])]
@@ -136,45 +131,36 @@
:layers [(assoc (texture "inside-house/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "inside-house/desk.png") :x 0 :y 0 :baseline 200)
(assoc (texture "inside-house/sillhoute.png") :x 0 :y 0 :baseline 240)]
:entities {:wizard (actions/start-animation screen (assoc (animation->texture screen wizard-stand) :x 228 :y 80 :baseline 160 :scale-x 1.75 :scale-y 1.75
:left {:talk (utils/flip wizard-talk)
:stand (utils/flip wizard-stand)
:disappear (utils/flip wizard-disappear)}
:right {:talk wizard-talk
:stand wizard-stand
:disappear wizard-disappear}
:talk-color (color 0.95 0.3 1.0 1.0)
:facing :left
:script (actions/get-script entities (do-wizard-dialogue entities))
:scripts #(condp = %
:kiss (actions/get-script entities
(actions/do-dialogue entities
:wizard "Good job boy! You saved a damsel in distress."
:wizard "You have proven yourself worthy in courage."))
:medal (actions/get-script entities
(actions/do-dialogue entities
:wizard "So you beat Captain McHulk at arm wrestling? "
:wizard "You must have been working out!"))
:trophy (actions/get-script entities
(actions/do-dialogue entities
:wizard "My, my, you have proven your worth in wisdom!"
:wizard "One day you'll be as wise as me!"))
:recipe (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:frog-legs (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:mandrake (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:flask-1 (actions/get-script entities
(actions/do-dialogue entities
:wizard "You can keep the flask."))
(actions/get-script entities
(actions/do-dialogue entities
:wizard "No thank you."))))
:stand)
:entities {:wizard (common/make-wizard screen {:x 228 :y 80 :baseline 160 :scale-x 1.75 :scale-y 1.75
:script (actions/get-script entities (do-wizard-dialogue entities))
:scripts #(condp = %
:kiss (actions/get-script entities
(actions/do-dialogue entities
:wizard "Good job boy! You saved a damsel in distress."
:wizard "You have proven yourself worthy in courage."))
:medal (actions/get-script entities
(actions/do-dialogue entities
:wizard "So you beat Captain McHulk at arm wrestling? "
:wizard "You must have been working out!"))
:trophy (actions/get-script entities
(actions/do-dialogue entities
:wizard "My, my, you have proven your worth in wisdom!"
:wizard "One day you'll be as wise as me!"))
:recipe (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:frog-legs (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:mandrake (actions/get-script entities
(actions/do-dialogue entities
:ego "I probably shouldn't show him that I have his stolen posessions."))
:flask-1 (actions/get-script entities
(actions/do-dialogue entities
:wizard "You can keep the flask."))
(actions/get-script entities
(actions/do-dialogue entities
:wizard "No thank you.")))})
:safe-lock (actions/start-animation screen (assoc (animation->texture screen safe-lock) :x 51 :y 95 :baseline 145
:stand safe-lock)
:stand)