Skip to content

Instantly share code, notes, and snippets.

@MattRoelle
Created April 7, 2022 22:53
Show Gist options
  • Save MattRoelle/52ab6c7b28c4e100b5ba9fda73f7ac45 to your computer and use it in GitHub Desktop.
Save MattRoelle/52ab6c7b28c4e100b5ba9fda73f7ac45 to your computer and use it in GitHub Desktop.
(λ do-attack [action]
(set action.to.animating true)
(set action.from.animating true)
(process-trigger-queue)
(let [mp (action.to.pos:midpoint action.from.pos)]
(timeline.parallel-tween
[0.5 action.from {:pos action.to.pos} :outBounce]))
;[0.5 action.from {:pos mp} :outBounce]))
(set action.from.animating false)
(set action.to.animating false)
(set action.from.attacks-remaining (- (or action.from.attacks-remaining 1) 1))
(set action.from.t (- action.from.t action.to.p))
(set action.to.t (- action.to.t action.from.p))
(timeline.wait 0.35)
(check-dead action.from)
(check-dead action.to)
(process-trigger-queue))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment