mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-25 08:22:15 +00:00
split collisions into a separate project (#308)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using System.Linq;
|
||||
using MonoGame.Extended.Maps.Tiled;
|
||||
|
||||
namespace MonoGame.Extended.Collisions
|
||||
{
|
||||
public static class CollisionWorldExtensions
|
||||
{
|
||||
public static CollisionGrid CreateGrid(this CollisionWorld world, TiledTileLayer tileLayer)
|
||||
{
|
||||
var data = tileLayer.Tiles
|
||||
.Select(t => t.Id)
|
||||
.ToArray();
|
||||
|
||||
return world.CreateGrid(data, tileLayer.Width, tileLayer.Height, tileLayer.TileWidth, tileLayer.TileHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user