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