NokiMo
Megan Fox
Megan Fox

patreon


Animation mirroring for tricks (the code)

So here's the code for that animation mirroring post. Here's the easy to copy pastebin. Really, it's pretty basic:

I just call this from the thing that starts the actual trick (the board movement) playing. You can think of animation parameters as optional things some tricks have, and all I do is set the parameters at the start of the trick, and clear any set animation parameters when it ends. Since it's all just strings, I can do a lot of extremely dumb string logic that would otherwise involve directional compares or enum swaps or something. Hooray!

This seriously works for basically everything. This dumb logic has covered everything I throw at it. Each time I think "woah added new thing it won't work" and then woops it does. It's my favorite.


Related Creators