Skip to content

Instantly share code, notes, and snippets.

@selfsame
Last active August 29, 2015 14:27
Show Gist options
  • Select an option

  • Save selfsame/0ae67fa10abd9da6e719 to your computer and use it in GitHub Desktop.

Select an option

Save selfsame/0ae67fa10abd9da6e719 to your computer and use it in GitHub Desktop.
(rule interact [a ad b bd] :default-interaction)
(rule interact [a ^:hp ad b ^:hp bd] :attack-interaction)
(rule interact [a ^:player ad b ^:item bd] :player-item-interaction)
(rule bump-enter [c collision _]
(let [a (->go c)
b (.collider collision)]
(when (and (data a) (data b))
(interact a (data a) b (data b)))))
(rule hard.life/start [c ns]
(clear-cloned!)
(data! (clone! :player) {:player true :actor true :hp 100})
(data! (clone! :treasure) {:item true})
(for [i (range 10)
:let [rat (clone! :rat (rand-vec 10 0 10))]]
(data! rat {:rat true :actor true :hp 20})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment