タイルの衝突を把握しようとしていますが、これを機能させることができません。タイルに衝突しても何も起こりません。
私の衝突クラス
public Point WorldToMapCell(Point worldPoint)
{
return new Point((int)worldPoint.X, (int)worldPoint.Y);
}
public MapCell GetCellAtWorldPoint(Point worldPoint)
{
Point mapPoint = WorldToMapCell(worldPoint);
return Rows[mapPoint.Y].Columns[mapPoint.X];
}
public MapCell GetCellAtWorldPoint(Vector2 worldPoint)
{
return GetCellAtWorldPoint(new Point((int)worldPoint.X, (int)worldPoint.Y));
}
私の更新方法
if (myMap.GetCellAtWorldPoint(player.position).Walkable == false)
{
player.velocity = Vector2.Zero;
}