Submissions from 2017-10-18 to 2017-10-19 (1 total)

Spent the night trying to add the concept of a 'direction' to the TileMask. Basically, I want the mask to be able to rotate when the player is moving in a certain direction so he can only, for example, lunge in front of him. In theory, this should be some really simple math involving rotating a 2D point around the origin. In practice, I had way too hard of a time converting it to a visualization in Editor script land.

Here's what I came up with:


Basically, you only edit the mask in 'right' direction, but it previews what the valid tiles will look like in each of the 4 cardinal directions. The mask will have a 'current direction' (which can be set by the caller), and the mask will take into account whether the specified tile is actually in the correctly rotated mask.