I have a playing field which is divided in 4 zones (as seen on the image below)
The player (blue) is on the second zone while there are 2 enemies (red) on the third zone. When the player throws an object and hits the enemy, the enemy is knockbacked in the next zone (4) but should stay within that zone.
If the enemy was being hit on the edge of the zone, I want him to still be in the zone 4 and not outside of it (if he got knocked back). I'm not sure if the direction of the hit matters in the calculation
Question: How can I find X?
Note that it can be on any shape of playing field (triangular, hexagonal, circular, ...)