I think you are taking it too hard.
Why not simply think like this:
- Simulate all possible next moves by same side
- If, in any resulting position in simulation, king is missing(captured) go to 4
- King is not in check, go to 5
- King is in check
- End
Why this works? Because if king is in check, it means if the same side plays again(plays double times) it can capture the king. So if it can capture the king by playing double moves, then it means opponent was in check.
For example, assume it's BlacksBlack to move again(plays double move):
rnb1kbnr/pppp1ppp/8/4p3/6Pq/5P2/PPPPP2P/RNBQKBNR w KQkq - 1 3
Enumerate all possible moves. Now check all resulting positions, is White king missing in any position? Then it means White king was in check.