为什么这样一个非常简单的碰撞代码能用几十次了,为什么这次不起作用呢?我只感觉卡在一边。
function PlayerMovingPlatformCollision()
{
var _movingPlatform = instance_place(x, y + max(1, yvelocity), oMovingPlatform);
(...)
//水平碰撞
if (_movingPlatform.moveX == 0) // plataforma 站立
{
//VV 这里就是问题所在 VV
if (place_meeting(x + (xvelocity), y, _movingPlatform))
{
//碰撞了
while (!place_meeting(x + sign(xvelocity), y, _movingPlatform))
{
x += sign(xvelocity);
}
xvelocity = 0;
}
}
else // plataforma 正移动
(...)
}
评论 (0)