javascript monster eating functions