错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Looping Statements

  • Wallace Wang,
  • Tonnetta Walcott

摘要

A loop repeats one or more commands multiple times. When you play a video game, the entire game represents a loop because as soon as you finish (or die in the game), the game gives you a chance to play again. That’s a loop. Within a game, you have smaller loops. Enemies may pop up and move in a predictable pattern, which represents a loop. Whenever a random enemy pops up, that is called spawning, and a program can run a loop to spawn more enemies. Fighting a single enemy represents a loop. Repeating the same game animation to fight an enemy is a loop. Any time you have repetitive action, that’s a loop.