我试图在if语句中为单个变量设置多个整数测试.逻辑运算符不会起作用,因为它们必须是布尔值.
例如:
if self.nodeAtPoint(location) == self.fake {
groundspeed = 35.0
self.button1value++
if(button1value == 2) {
groundspeed = 5.0
}
if(button1value == 4){
groundspeed = 5.0
}
if(button1value == 6) {
groundspeed = 5.0
}
}
Run Code Online (Sandbox Code Playgroud)
目标是能够将所有偶数显示在一个if语句中.