If the game freezes, just click inside it (games can get unresponsive if you click elsewhere on the page).
Clear all dangerous creatures from each depth level and collect the treasures. When creatures are removed, collect the treasure. Creatures automatically attack other creatures that are one step below them in the food chain. the food chain is shown beneath the game.