【发布时间】:2012-11-06 00:18:40
【问题描述】:
我的碰撞有点问题,在最终弄清楚如何让它碰撞之后,我只能让 pacman 重置到一个设定的位置,不知道如何让他留在他应该在的地方.
player.update();
for (int y = 0; y < NrOfTilesY; y++)
{
for (int x = 0; x < NrOfTilesX; x++)
{
if (tileArray[x, y] is Nest)
{
Rectangle rectW = tileArray[x, y].Bounds();
Rectangle rectP = Player.pacmanBounds;
if(rectW.Intersects(rectP))
{
Player.pacmanBounds.X = 32;
Player.pacmanBounds.Y = 32;
}
}
}
}
【问题讨论】: