Wow this was cool. At first I thought this was just going to be straightforward, but then I realized that order matters, and I had to really plan things out.
I think there is potential to turn this into a cool puzzle game. Maybe if the monsters don't keep reappearing there might be an interesting puzzle mechanic.
In any case, good job!