aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Letan <contact@thomasletan.fr>2018-07-01 19:10:04 +0200
committerThomas Letan <contact@thomasletan.fr>2018-07-01 19:10:04 +0200
commit06bd0d2f6689415a000550dbc8560928c4ec7918 (patch)
tree967bb638857409d06b3f020b992c120323fc4814
parentfeature: Add a small animation when a puppet is hurted (diff)
feature: Reorder puppets by y-axis
-rw-r--r--lykanc/client.lisp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lykanc/client.lisp b/lykanc/client.lisp
index 7e53c7c..0d2f586 100644
--- a/lykanc/client.lisp
+++ b/lykanc/client.lisp
@@ -37,7 +37,10 @@
(defmethod init-map ((app client) map-key)
(let* ((tmx-file (concatenate 'string *maps_dir* map-key ".tmx"))
(map-layer (make-instance 'fairy/tiled:tile-map :path tmx-file)))
- (setf (fairy:get-child app :game-scene) map-layer)))
+ (setf (fairy:get-child app :game-scene) map-layer))
+ (setf (fairy:sort-with (get-objects-layer app))
+ (lambda (p1 p2)
+ (> (gamekit:y (fairy:origin p1)) (gamekit:y (fairy:origin p2))))))
(defmethod get-objects-layer ((app client))
(fairy/tiled:get-map-layer (fairy:get-child app :game-scene) "objects"))