Implemented a fix for a bug that could cause the castle to move off-screen and make progress impossible.
Although I have not been able to reproduce the exact reported situation, I confirmed that in a test where a similar state was artificially created, the castle now stays within the screen after the fix.
