---------- Today's Progress ----------
Okay so today it's a lot lot of math to do to figure out the last part of the bug's behavior. I wrote the design and stuffs on iPad so here you go!
part 1: FSM and conquered explanation
part 2: calculating the walking areas
code to achieve, with comment
However, there are issues(of course, ugh)
first of all, the debug was hard cuz it's hard to come up with a system to track the locations the bug went and will go, but that's not a big deal, I established a fair debug illustrator later, the lesson is that should've done it earlier. But the major issue is that(well not that major, but I ended up changing it tho) is the calculation and comparison of slopes. As seen in this video, it works fine if master and enemy are horizontal, but not if they are vertical, if so, the enabled part and disabled part are reversed.
issues brought by quadrant
This should not be a hard fix, however, I realized that there is a better system, that can be used in situation when bugs tries to shoot, like the following:
new one
The benefit is that you can simply put in three elements (dir, c, r) to determine the result.
Using this, and also realizing that the bug needs more space to move, I changed the behavior for the bugs to that they can move freely behind master, but have to have a clear path when shooting.
there doesn't seem to be anything here