Skip to content

Instantly share code, notes, and snippets.

@MattRoelle
Created April 7, 2022 22:56
Show Gist options
  • Save MattRoelle/cf55070af51a9d35e608982fe846ccc2 to your computer and use it in GitHub Desktop.
Save MattRoelle/cf55070af51a9d35e608982fe846ccc2 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.to {:pos mp} :outBounce]
[0.5 action.from {:pos mp} :outBounce]))
(set action.from.animating false)
(set action.to.animating false)
(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