As soon as I detect with what we'll call a condition if I'm touching the edge I have to essentially spin around 180 degrees and then continue looping.
一旦我检测到这种情况,当我碰到边界时,我需要转180°然后继续这一循环过程。
You've got a loop, you've got a condition and a boolean to check if he's touching the edge, and some statements to tell him to shout or to actually turn around.
我们有一个循环,通过一个条件和一个布尔值来判断,是否触到了边缘,还有一些语句,让它回头并咆哮。
应用推荐