itch.io is community of indie game creators and players

Devlogs

Adding line of sight

Onikai
A browser Onikai made in HTML5

Onikai uses "line of sight" to determine which units are reachable by the other team. 

Well it's pretty simple, we give each unit a box which is as large as it's own tile, then we shoot rays at potential targets and only returns the ones that hit.  


it's important to note that the collides are the size of the square the units occupy, and they are all the same size.  This makes it so that no rays squeeze in between at odd angles

Notice we cannot "see" the units in the back, as noted by the 🚫

Once a unit is dazed, we make its collider really short (so that they can still be targeted, but cannot block line of sight), and presto, everything just works.

Now to finish the job 😈 🏹🏹🏹


Play Onikai for free, in your browser, right now!
http://mythicalelephantgames.itch.io/

Leave a comment