这会导致与其他对象发生碰撞并且无法正常工作,
我觉得这可能与我们如何为玩家旋转精灵有关,下面是我们用于旋转的代码
#region draw player
if (player.facing == 4)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 1.5708f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 3)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 4.712389f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 1)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 0, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 2)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 3.14593f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 5)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 0.785398163f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 6)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 2.094395102f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 7)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 3.839724354f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
else if (player.facing == 8)
spriteBatch.Draw(player.txr, player.drawRect, null, Color.White, 5.497787144f, new Vector2(player.drawRect.Width / 2, player.drawRect.Height / 2), SpriteEffects.None, 0);
#region DEBUG
//spriteBatch.Draw(Door.txr, player.drawRect, Color.White);
//spriteBatch.Draw(Door.txr, player1.drawRect, Color.White);
//spriteBatch.Draw(Door.txr, player2.drawRect, Color.White);
//spriteBatch.Draw(Door.txr, player3.drawRect, Color.White);
#endregion