我正在测试for循环,以便在屏幕上平滑移动对象.
int yPosLeft = 339;
int originalYPosLeft = yPosLeft;
for(yPosLeft < 30 + originalYPosLeft; yPosLeft++) {
// Changes the value in the statement
}
Run Code Online (Sandbox Code Playgroud)
然而,循环以某种方式使对象的y位置永远进入负数百万,并且几乎需要强制退出.有什么建议?
更新:我对此很愚蠢.为#BrainFart #Fixed道歉