基本上,我很好奇,如果xVel
和yVel
变量将工作最好,或者如果我应该使用velocity
和direction
变量。最有效的方法来处理速度
而且,这是怎么会在更新处理:(伪代码) 对于xVel
和yVel
:
x += xVel;
y += yVel;
对于velocity
和direction
:
x += velocity * (cos(direction));
y += velocity * (sin(direction));
注:我不知道如果第二个将正常工作。我没有三角函数技能。
那么,第一种方法更有效,还是第二种?我在做第二个完全错误的?