The beetle, however, is showing signs of awareness of the party. It has raised its head, it's forward feelers are moving rapidly all of the sudden and it is making a distinct clicking sound.
The party has initiative.
They use it to kill the beetle. Here's the end of everyone's movement: