That is not the correct way to write a loop at all. It's just constantly checking map:has_entities("rope") over and over again in an endless loop that won't allow for anything else to happen in the mean time. It's doing way more processing than it needs to and wil hinder the rest of the game from being able to run properly.
Compare it to Yoshi's method that counts the number of entities present once any time one of them dies. Until one of them dies, the number of them isn't going to change, so no need to be checking it over and over again in between. See how this method is vastly better?
Compare it to Yoshi's method that counts the number of entities present once any time one of them dies. Until one of them dies, the number of them isn't going to change, so no need to be checking it over and over again in between. See how this method is vastly better?