removing hotspots because cursor capturing sucks.
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
resized ))
|
||||
|
||||
(defn right-click [screen entities]
|
||||
(let [entities (update-in entities [:cursor] #(assoc % :cursor-index (+next-cursor+ (:cursor-index %)) :hotspot [0 0 ]))]
|
||||
(let [entities (update-in entities [:cursor] #(assoc % :cursor-index (+next-cursor+ (:cursor-index %))))]
|
||||
(input! :set-cursor-image (cursor "cursor.png" (get-in entities [:cursor :cursor-index])) 0 0)
|
||||
entities))
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
music (sound "outside-house.mp3")
|
||||
_ (sound! music :loop)]
|
||||
{
|
||||
:cursor {:id "cursor" :cursor-index 0 :hotspot [63 63]}
|
||||
:cursor {:id "cursor" :cursor-index 0 }
|
||||
:background (assoc background
|
||||
:id "background" :x 0 :y 0
|
||||
:collision (advent.pathfind/map-from-resource "pathfind-test-big.png")
|
||||
@@ -130,12 +130,9 @@
|
||||
|
||||
|
||||
:on-touch-down (fn [screen [entities]]
|
||||
(let [screen (-> screen
|
||||
(update-in [:input-x] #(+ % (first (:hotspot (:cursor entities)))))
|
||||
(update-in [:input-y] #(+ % (second (:hotspot (:cursor entities))))))]
|
||||
(if (= (button-code :right) (:button screen))
|
||||
(right-click screen entities)
|
||||
(left-click screen entities)))))
|
||||
(if (= (button-code :right) (:button screen))
|
||||
(right-click screen entities)
|
||||
(left-click screen entities))))
|
||||
|
||||
(defgame advent
|
||||
:on-create
|
||||
|
||||
Reference in New Issue
Block a user