start with correct scale.
This commit is contained in:
@@ -86,7 +86,7 @@
|
|||||||
entities))))
|
entities))))
|
||||||
|
|
||||||
|
|
||||||
(defn get-ego [screen start-pos]
|
(defn get-ego [screen start-pos start-scale]
|
||||||
(let [player-sheet (texture! (texture "player.png") :split 18 36)
|
(let [player-sheet (texture! (texture "player.png") :split 18 36)
|
||||||
talk-sheet (texture! (texture "ego/talk.png") :split 18 36)
|
talk-sheet (texture! (texture "ego/talk.png") :split 18 36)
|
||||||
stand-sheet (texture! (texture "ego/stand.png") :split 18 36)
|
stand-sheet (texture! (texture "ego/stand.png") :split 18 36)
|
||||||
@@ -163,6 +163,8 @@
|
|||||||
:origin-y 0
|
:origin-y 0
|
||||||
:scaled true
|
:scaled true
|
||||||
:step-sound (sound "ego/step.ogg")
|
:step-sound (sound "ego/step.ogg")
|
||||||
|
:scale-x start-scale
|
||||||
|
:scale-y start-scale
|
||||||
|
|
||||||
:mouse-in? (fn [entities x y]
|
:mouse-in? (fn [entities x y]
|
||||||
(let [{entity-x :x entity-y :y region :object scale :scale-x} (get-in entities [:room :entities :ego])
|
(let [{entity-x :x entity-y :y region :object scale :scale-x} (get-in entities [:room :entities :ego])
|
||||||
@@ -280,7 +282,7 @@
|
|||||||
:override nil}
|
:override nil}
|
||||||
:all-items (assoc items/items :object nil)
|
:all-items (assoc items/items :object nil)
|
||||||
:room (as-> (get rooms (:last-room (get-state))) room
|
:room (as-> (get rooms (:last-room (get-state))) room
|
||||||
(assoc-in room [:entities :ego] (get-ego screen (:start-pos room))))
|
(assoc-in room [:entities :ego] (get-ego screen (:start-pos room) ((:scale-fn room) (:start-pos room)))))
|
||||||
:inventory (assoc (texture "inventory.png") :x 278 :y 0 :baseline 9000
|
:inventory (assoc (texture "inventory.png") :x 278 :y 0 :baseline 9000
|
||||||
:mouse-in? (zone/box 278 0 320 42))
|
:mouse-in? (zone/box 278 0 320 42))
|
||||||
:fps (assoc (label "0" (color :white) ) :x 5 :baseline 0)}]
|
:fps (assoc (label "0" (color :white) ) :x 5 :baseline 0)}]
|
||||||
|
|||||||
Reference in New Issue
Block a user