Cat and ghosts moving

master
BraydonKains 5 years ago
parent 4be05cff2d
commit 0229f9f055

File diff suppressed because one or more lines are too long

@ -1,68 +1,139 @@
{ {
"name": "cat", "name": "cat",
"image": "catsandghosts", "image": "Master-no-background-01",
"width": 32, "width": 32,
"height": 32, "height": 32,
"animations": [ "animations": [
{ {
"id": 1, "id": 1,
"name": "Idle", "name": "Walk Left",
"frames": [ "frames": [
{ {
"id": 1, "id": 1,
"x": 32,
"y": 64,
"timer": 8
},
{
"id": 2,
"x": 64,
"y": 64,
"timer": 8
},
{
"id": 3,
"x": 0, "x": 0,
"y": 32, "y": 64,
"timer": 0 "timer": 8
} }
] ]
}, },
{ {
"id": 2, "id": 2,
"name": "Walk X", "name": "Walk Right",
"frames": [ "frames": [
{ {
"id": 1, "id": 1,
"x": 64, "x": 32,
"y": 32, "y": 96,
"timer": 8 "timer": 8
}, },
{ {
"id": 2, "id": 2,
"x": 32, "x": 64,
"y": 32, "y": 96,
"timer": 8 "timer": 8
}, },
{ {
"id": 3, "id": 3,
"x": 0, "x": 0,
"y": 32, "y": 96,
"timer": 8 "timer": 8
} }
] ]
}, },
{ {
"id": 3, "id": 3,
"name": "Walk Y", "name": "Walk Up",
"frames": [ "frames": [
{ {
"id": 1, "id": 1,
"x": 32, "x": 32,
"y": 64, "y": 128,
"timer": 8 "timer": 6
}, },
{ {
"id": 2, "id": 2,
"x": 64, "x": 0,
"y": 64, "y": 128,
"timer": 8 "timer": 6
} }
] ]
}, },
{ {
"id": 4, "id": 4,
"name": "Scared", "name": "Walk Down",
"frames": [
{
"id": 1,
"x": 32,
"y": 160,
"timer": 6
},
{
"id": 2,
"x": 0,
"y": 160,
"timer": 6
}
]
},
{
"id": 5,
"name": "Scared Left",
"frames": [
{
"id": 1,
"x": 96,
"y": 64,
"timer": 0
}
]
},
{
"id": 6,
"name": "Scared Right",
"frames": [
{
"id": 1,
"x": 96,
"y": 96,
"timer": 0
}
]
},
{
"id": 7,
"name": "Scared Up",
"frames": [ "frames": [
{
"id": 1,
"x": 64,
"y": 128,
"timer": 0
}
]
},
{
"id": 8,
"name": "Scared Down",
"frames": [
{
"id": 1,
"x": 64,
"y": 160,
"timer": 0
}
] ]
} }
] ]

@ -0,0 +1,80 @@
{
"name": "ghost",
"image": "Master-no-background-01",
"width": 32,
"height": 32,
"animations": [
{
"id": 1,
"name": "Walk Left",
"frames": [
{
"id": 1,
"x": 0,
"y": 32,
"timer": 6
},
{
"id": 2,
"x": 32,
"y": 32,
"timer": 6
}
]
},
{
"id": 2,
"name": "Walk Right",
"frames": [
{
"id": 1,
"x": 0,
"y": 0,
"timer": 6
},
{
"id": 2,
"x": 32,
"y": 0,
"timer": 6
}
]
},
{
"id": 3,
"name": "Walk Up",
"frames": [
{
"id": 1,
"x": 64,
"y": 0,
"timer": 6
},
{
"id": 2,
"x": 64,
"y": 32,
"timer": 6
}
]
},
{
"id": 4,
"name": "Walk Down",
"frames": [
{
"id": 1,
"x": 96,
"y": 0,
"timer": 6
},
{
"id": 2,
"x": 96,
"y": 32,
"timer": 6
}
]
}
]
}

@ -1,3 +1,4 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -7,12 +8,16 @@ namespace SeeNoEvil.Character {
public string Image {get; private set;} public string Image {get; private set;}
public int Width {get; private set;} public int Width {get; private set;}
public int Height {get; private set;} public int Height {get; private set;}
public bool Idle;
public Dictionary<int, Animation> Animations {get; private set;} public Dictionary<int, Animation> Animations {get; private set;}
private Animation CurrentAnimation; private Animation CurrentAnimation;
public Frame CurrentFrame =>
CurrentAnimation.GetFrame(); public Frame CurrentFrame {
public bool IsDefault => get {
CurrentAnimation.Id == 1; if(Idle) return CurrentAnimation.CurrentFrame;
else return CurrentAnimation.GetFrame();
}
}
public AnimationController(AnimationSetModel model) { public AnimationController(AnimationSetModel model) {
Name = model.Name; Name = model.Name;
@ -25,6 +30,7 @@ namespace SeeNoEvil.Character {
return animations; return animations;
}); });
ChangeAnimation(1); ChangeAnimation(1);
Idle = true;
} }
public void ChangeAnimation(int animationId) { public void ChangeAnimation(int animationId) {
@ -37,8 +43,8 @@ namespace SeeNoEvil.Character {
public int Id {get; set;} public int Id {get; set;}
public string Name {get; set;} public string Name {get; set;}
public FrameCollection Frames {get; set;} public FrameCollection Frames {get; set;}
public Frame CurrentFrame;
private int TotalFrames; private int TotalFrames;
private Frame CurrentFrame;
private int CurrentFrameId; private int CurrentFrameId;
public Animation(AnimationModel model) { public Animation(AnimationModel model) {

@ -7,6 +7,21 @@ namespace SeeNoEvil.Character {
Width = AnimationController.Width; Width = AnimationController.Width;
Height = AnimationController.Height; Height = AnimationController.Height;
Facing = facing; Facing = facing;
//FIXME Can probably share this code
switch(Facing) {
case Direction.Up:
AnimationController.ChangeAnimation(3);
break;
case Direction.Down:
AnimationController.ChangeAnimation(4);
break;
case Direction.Left:
AnimationController.ChangeAnimation(1);
break;
case Direction.Right:
AnimationController.ChangeAnimation(2);
break;
}
} }
public override void Move(Direction direction) { public override void Move(Direction direction) {
@ -16,10 +31,10 @@ namespace SeeNoEvil.Character {
AnimationController.ChangeAnimation(3); AnimationController.ChangeAnimation(3);
break; break;
case Direction.Down: case Direction.Down:
AnimationController.ChangeAnimation(3); AnimationController.ChangeAnimation(4);
break; break;
case Direction.Left: case Direction.Left:
AnimationController.ChangeAnimation(2); AnimationController.ChangeAnimation(1);
break; break;
case Direction.Right: case Direction.Right:
AnimationController.ChangeAnimation(2); AnimationController.ChangeAnimation(2);

@ -1,18 +1,20 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using SeeNoEvil.Level;
namespace SeeNoEvil.Character { namespace SeeNoEvil.Character {
public class Character { public class Character {
private Vector2 Destination {get; set;} private Vector2 Destination {get; set;}
private Vector2 Velocity {get; set;} private Vector2 Velocity {get; set;}
private Vector2 Position {get; set;} public Vector2 Position {get; private set;}
private Texture2D SpriteSheet; private Texture2D SpriteSheet;
protected AnimationController AnimationController; protected AnimationController AnimationController;
protected int Width; protected int Width;
protected int Height; protected int Height;
protected Direction Facing; protected Direction Facing;
protected PlayField Field;
protected bool Moving => protected bool Moving =>
!Destination.Equals(Vector2.Zero) && !Destination.Equals(Vector2.Zero) &&
@ -25,16 +27,18 @@ namespace SeeNoEvil.Character {
Velocity = Vector2.Zero; Velocity = Vector2.Zero;
} }
public void Load(ContentManager content) { public void Load(ContentManager content, PlayField playField) {
SpriteSheet = content.Load<Texture2D>(AnimationController.Image); SpriteSheet = content.Load<Texture2D>(AnimationController.Image);
Field = playField;
} }
// TODO Do I want to move every frame? // TODO Do I want to move every frame?
public void Update() { public void Update() {
if(Moving) if(Moving) {
Position = Vector2.Add(Position, Velocity); Position = Vector2.Add(Position, Velocity);
else if(!AnimationController.IsDefault) AnimationController.Idle = false;
AnimationController.ChangeAnimation(1); }
else AnimationController.Idle = true;
} }
public void Draw(SpriteBatch spriteBatch) { public void Draw(SpriteBatch spriteBatch) {
@ -44,11 +48,11 @@ namespace SeeNoEvil.Character {
AnimationController.Width, AnimationController.Width,
AnimationController.Height); AnimationController.Height);
spriteBatch.Draw(SpriteSheet, Position, srcRectangle, Color.White); spriteBatch.Draw(SpriteSheet, Position, srcRectangle, Color.White);
// spriteBatch.Draw(SpriteSheet, Position, Color.White);
} }
public virtual void Move(Direction direction) { public virtual void Move(Direction direction) {
if(!Moving) { if(!Moving) {
int velocity = 1;
int x = 0, y = 0; int x = 0, y = 0;
switch(direction) { switch(direction) {
case Direction.Up: case Direction.Up:
@ -64,8 +68,11 @@ namespace SeeNoEvil.Character {
x = 1; x = 1;
break; break;
} }
var tryPosition = Vector2.Add(Position, new Vector2(Width*x, Height*y));
if(Field.TryWalk(tryPosition)) {
Destination = Vector2.Add(Position, new Vector2(Width*x, Height*y)); Destination = Vector2.Add(Position, new Vector2(Width*x, Height*y));
Velocity = new Vector2(x, y); Velocity = new Vector2(x*velocity, y*velocity);
}
} }
} }
} }

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using SeeNoEvil.Level;
using SeeNoEvil.Tiled;
namespace SeeNoEvil.Character {
public class GhostController {
public List<Ghost> Ghosts {get; set;}
public GhostController(IEnumerable<ObjectCoordinate> coordinates) {
Ghosts = coordinates.Select(
coord => new Ghost(new Vector2(coord.X, coord.Y))
).ToList();
}
public void LoadAll(ContentManager content, PlayField playField) {
Ghosts.ForEach(ghost => ghost.Load(content, playField));
}
public void DrawAll(SpriteBatch spriteBatch) {
Ghosts.ForEach(ghost => ghost.Draw(spriteBatch));
}
public void UpdateAll() {
Ghosts.ForEach(ghost => ghost.Update());
}
public void MoveGhosts() {
Ghosts.ForEach(ghost => ghost.DecideMove());
}
}
public class Ghost : Character {
public Ghost(Vector2 position) : base(position) {
AnimationController = new AnimationController(AnimationParser.ReadAnimationJson("SeeNoEvil/Animation/ghost.json"));
Width = AnimationController.Width;
Height = AnimationController.Height;
Facing = Direction.Down;
}
public void DecideMove() {
Array values = Enum.GetValues(typeof(Direction));
Random random = new Random();
Direction randomDirection = (Direction)values.GetValue(random.Next(values.Length));
switch(randomDirection) {
case Direction.Up:
AnimationController.ChangeAnimation(3);
break;
case Direction.Down:
AnimationController.ChangeAnimation(4);
break;
case Direction.Left:
AnimationController.ChangeAnimation(1);
break;
case Direction.Right:
AnimationController.ChangeAnimation(2);
break;
}
base.Move(randomDirection);
}
}
}

@ -10,7 +10,7 @@ namespace SeeNoEvil.Level {
private Vector3 TranslationVector => private Vector3 TranslationVector =>
new Vector3(-Centre.X + (Viewport.Width / 2), new Vector3(-Centre.X + (Viewport.Width / 2),
-Centre.Y + (Viewport.Height / 2), -Centre.Y + (Viewport.Height / 2),
0); 1);
public Camera(Viewport _viewport) { public Camera(Viewport _viewport) {
Viewport = _viewport; Viewport = _viewport;
@ -18,8 +18,9 @@ namespace SeeNoEvil.Level {
Centre = new Vector2(Viewport.Width / 2, Viewport.Height / 2); Centre = new Vector2(Viewport.Width / 2, Viewport.Height / 2);
} }
//FIXME Don't need velocity anymore?
public void Update(Vector2 position, Vector2 velocity) { public void Update(Vector2 position, Vector2 velocity) {
Centre = Vector2.Add(Centre, velocity); Centre = position;
Transform = Matrix.CreateTranslation(TranslationVector); Transform = Matrix.CreateTranslation(TranslationVector);
} }
} }

@ -1,10 +1,12 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using SeeNoEvil.Tiled;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using SeeNoEvil.Tiled;
namespace SeeNoEvil.Level { namespace SeeNoEvil.Level {
public class TilemapLevel { public class TilemapLevel {
private readonly string MapName; private readonly string MapName;
@ -18,6 +20,7 @@ namespace SeeNoEvil.Level {
public void LoadMap(ContentManager content) { public void LoadMap(ContentManager content) {
Map = new TiledMap(TiledParser.ReadMapJson(MapName)); Map = new TiledMap(TiledParser.ReadMapJson(MapName));
Map.LoadView(); Map.LoadView();
Map.LoadObjects();
TilesetTextures = Map.GetTilesetNames().Aggregate(new Dictionary<string, Texture2D>(), TilesetTextures = Map.GetTilesetNames().Aggregate(new Dictionary<string, Texture2D>(),
(textures, contentName) => { (textures, contentName) => {
textures.Add(contentName, content.Load<Texture2D>(contentName)); textures.Add(contentName, content.Load<Texture2D>(contentName));
@ -25,8 +28,24 @@ namespace SeeNoEvil.Level {
}); });
} }
private IEnumerable<string> GetTilesetNames() { private IEnumerable<string> GetTilesetNames() => Map.GetTilesetNames();
return Map.GetTilesetNames();
public Vector2 GetPlayerPosition() {
//FIXME This fuckin sucks
Map.Objects.TryGetValue("Cat", out List<ObjectCoordinate> catCoords);
ObjectCoordinate catCoord = catCoords.First();
return new Vector2(catCoord.X, catCoord.Y);
}
public PlayField GetPlayField() {
Map.View.TryGetValue("Ground", out List<TileLocation> ground);
return new PlayField(ground.Where(tile => tile.tile.gid != 0));
}
public IEnumerable<ObjectCoordinate> GetGhostCoordinates() {
// FIXME this fuckin sucks too I think?
Map.Objects.TryGetValue("Ghosts", out List<ObjectCoordinate> ghosts);
return ghosts;
} }
public void Draw(SpriteBatch spriteBatch, string layer) { public void Draw(SpriteBatch spriteBatch, string layer) {

@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using SeeNoEvil.Tiled;
namespace SeeNoEvil.Level {
public class PlayField {
private IEnumerable<TileLocation> Tiles {get; set;}
public PlayField(IEnumerable<TileLocation> tiles) {
Tiles = tiles;
}
public bool TryWalk(Vector2 newLocation) =>
Tiles.Any(tile => tile.location.Equals(newLocation));
}
}

@ -17,7 +17,9 @@ namespace SeeNoEvil
SpriteBatch spriteBatch; SpriteBatch spriteBatch;
TilemapLevel level; TilemapLevel level;
Camera camera; Camera camera;
Cat cat; Cat player;
GhostController enemyController;
PlayField playField;
public SeeNoEvilGame() public SeeNoEvilGame()
{ {
@ -28,10 +30,9 @@ namespace SeeNoEvil
protected override void Initialize() protected override void Initialize()
{ {
// TODO: Add your initialization logic here // level = new TilemapLevel("./Maps/MagicLandCsv.json");
level = new TilemapLevel("./Maps/MagicLandCsv.json");
// level = new TilemapLevel("./Maps/test.json"); // level = new TilemapLevel("./Maps/test.json");
cat = new Cat(Vector2.Zero, Direction.Right); level = new TilemapLevel("./Maps/level.json");
base.Initialize(); base.Initialize();
} }
@ -40,7 +41,11 @@ namespace SeeNoEvil
{ {
spriteBatch = new SpriteBatch(GraphicsDevice); spriteBatch = new SpriteBatch(GraphicsDevice);
level.LoadMap(Content); level.LoadMap(Content);
cat.Load(Content); playField = level.GetPlayField();
player = new Cat(level.GetPlayerPosition(), Direction.Right);
player.Load(Content, playField);
enemyController = new GhostController(level.GetGhostCoordinates());
enemyController.LoadAll(Content, playField);
camera = new Camera(GraphicsDevice.Viewport); camera = new Camera(GraphicsDevice.Viewport);
} }
@ -49,26 +54,25 @@ namespace SeeNoEvil
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit(); Exit();
int xVelocity = 0, yVelocity = 0; camera.Update(player.Position, Vector2.Zero);
// if(Keyboard.GetState().IsKeyDown(Keys.Down)) if(Keyboard.GetState().IsKeyDown(Keys.Down)) {
// yVelocity = 1; player.Move(Direction.Down);
// if(Keyboard.GetState().IsKeyDown(Keys.Up)) enemyController.MoveGhosts();
// yVelocity = -1; }
// if(Keyboard.GetState().IsKeyDown(Keys.Left)) if(Keyboard.GetState().IsKeyDown(Keys.Up)) {
// xVelocity = -1; player.Move(Direction.Up);
// if(Keyboard.GetState().IsKeyDown(Keys.Right)) enemyController.MoveGhosts();
// xVelocity = 1; }
camera.Update(Vector2.Zero, new Vector2(xVelocity, yVelocity)); if(Keyboard.GetState().IsKeyDown(Keys.Left)) {
player.Move(Direction.Left);
if(Keyboard.GetState().IsKeyDown(Keys.Down)) enemyController.MoveGhosts();
cat.Move(Direction.Down); }
if(Keyboard.GetState().IsKeyDown(Keys.Up)) if(Keyboard.GetState().IsKeyDown(Keys.Right)) {
cat.Move(Direction.Up); player.Move(Direction.Right);
if(Keyboard.GetState().IsKeyDown(Keys.Left)) enemyController.MoveGhosts();
cat.Move(Direction.Left); }
if(Keyboard.GetState().IsKeyDown(Keys.Right)) player.Update();
cat.Move(Direction.Right); enemyController.UpdateAll();
cat.Update();
base.Update(gameTime); base.Update(gameTime);
} }
@ -80,8 +84,11 @@ namespace SeeNoEvil
spriteBatch.Begin( spriteBatch.Begin(
transformMatrix: camera.Transform transformMatrix: camera.Transform
); );
// level.Draw(spriteBatch, "background"); level.Draw(spriteBatch, "Sky");
cat.Draw(spriteBatch); level.Draw(spriteBatch, "Ground");
level.Draw(spriteBatch, "Bushes");
player.Draw(spriteBatch);
enemyController.DrawAll(spriteBatch);
spriteBatch.End(); spriteBatch.End();
base.Draw(gameTime); base.Draw(gameTime);

@ -4,7 +4,7 @@ using System.Linq;
using SeeNoEvil.Level; using SeeNoEvil.Level;
namespace SeeNoEvil.Tiled { namespace SeeNoEvil.Tiled {
public class MapLayer { public class TileLayer {
public string Type {get; private set;} public string Type {get; private set;}
public string Name {get; private set;} public string Name {get; private set;}
@ -14,7 +14,7 @@ namespace SeeNoEvil.Tiled {
private int Height; private int Height;
private List<uint> Data; private List<uint> Data;
public MapLayer(MapLayerModel model) { public TileLayer(MapLayerModel model) {
Name = model.Name; Name = model.Name;
Width = model.Width; Width = model.Width;
Height = model.Height; Height = model.Height;

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
//TODO Do all these need to be public?
namespace SeeNoEvil.Tiled {
//TODO Can probably be a struct?
public class ObjectLayer {
public IEnumerable<ObjectCoordinate> Objects {get; private set;}
public string Name {get; private set;}
public ObjectLayer(MapLayerModel model) {
Name = model.Name;
Objects = model.Objects.Select(o => new ObjectCoordinate(o.Id,
o.X,
o.Y));
}
}
public struct ObjectCoordinate {
public ObjectCoordinate(int id, float x, float y) {
X = (int)Math.Round(x / 32)*32;
Y = (int)Math.Round(y / 32)*32;
Id = id;
}
public int X {get; set;}
public int Y {get; set;}
public int Id {get; set;}
}
}

@ -6,8 +6,10 @@ using SeeNoEvil.Level;
namespace SeeNoEvil.Tiled { namespace SeeNoEvil.Tiled {
public class TiledMap { public class TiledMap {
public Dictionary<string, List<TileLocation>> View {get; private set;} public Dictionary<string, List<TileLocation>> View {get; private set;}
public Dictionary<string, List<ObjectCoordinate>> Objects {get; private set;}
private bool Infinite; private bool Infinite;
private List<MapLayer> Layers; private List<TileLayer> TileLayers;
private List<ObjectLayer> ObjectLayers;
private List<TileSet> TileSets; private List<TileSet> TileSets;
private int TileHeight; private int TileHeight;
private int TileWidth; private int TileWidth;
@ -18,7 +20,10 @@ namespace SeeNoEvil.Tiled {
public TiledMap(TiledModel model) { public TiledMap(TiledModel model) {
Infinite = model.Infinite; Infinite = model.Infinite;
Layers = model.Layers.Select(model => new MapLayer(model)).ToList(); TileLayers = model.Layers.Where(model => model.Type == "tilelayer")
.Select(model => new TileLayer(model)).ToList();
ObjectLayers = model.Layers.Where(model => model.Type == "objectgroup")
.Select(model => new ObjectLayer(model)).ToList();
TileSets = model.TileSets.Select(model => new TileSet(model)).ToList(); TileSets = model.TileSets.Select(model => new TileSet(model)).ToList();
TileHeight = model.TileHeight; TileHeight = model.TileHeight;
TileWidth = model.TileWidth; TileWidth = model.TileWidth;
@ -35,7 +40,7 @@ namespace SeeNoEvil.Tiled {
public void LoadView() { public void LoadView() {
// Get all tilelayers // Get all tilelayers
Dictionary<string, List<DataCoordinate>> layerData = new Dictionary<string, List<DataCoordinate>>(); Dictionary<string, List<DataCoordinate>> layerData = new Dictionary<string, List<DataCoordinate>>();
Layers.Where(layer => layer.Type == "tilelayer").ToList() TileLayers.Where(layer => layer.Type == "tilelayer").ToList()
.ForEach(layer => { .ForEach(layer => {
layerData.Add(layer.Name, layer.DataCoordinates); layerData.Add(layer.Name, layer.DataCoordinates);
}); });
@ -75,6 +80,17 @@ namespace SeeNoEvil.Tiled {
}); });
} }
// Load objects on the level
public void LoadObjects() {
Objects = ObjectLayers.Aggregate(new Dictionary<string, List<ObjectCoordinate>>(),
// FIXME This is stupid naming
(layers, objects) => {
layers.Add(objects.Name, objects.Objects.ToList());
return layers;
}
);
}
// Load tiles into cache if they don't exist // Load tiles into cache if they don't exist
private void LoadTiles(HashSet<uint> tiles) { private void LoadTiles(HashSet<uint> tiles) {
foreach(uint gid in tiles) { foreach(uint gid in tiles) {
@ -86,4 +102,5 @@ namespace SeeNoEvil.Tiled {
} }
} }
} }
} }

@ -24,12 +24,18 @@ namespace SeeNoEvil.Tiled {
public int TileCount {get; set;} public int TileCount {get; set;}
} }
public struct MapLayerModel { public struct MapLayerModel {
public string Name {get; set;} public string Name {get; set;}
public int Width {get; set;} public int Width {get; set;}
public int Height {get; set;} public int Height {get; set;}
public IEnumerable<uint> Data {get; set;} public IEnumerable<uint> Data {get; set;}
public string Type {get; set;} public string Type {get; set;}
public IEnumerable<TiledObjectModel> Objects {get; set;}
}
public struct TiledObjectModel {
public int Id {get; set;}
public float X {get; set;}
public float Y {get; set;}
} }
} }
Loading…
Cancel
Save