public bool IsCellOpen(Point point)\r
{\r
if (!State.Map.IsCellOpen(point)) return false;\r
- if (GetEntityAtCoordinates(point) != null) return false;\r
+ IEntity entity = GetEntityAtCoordinates(point);\r
+ if (entity != null && entity.IsCollidable) return false;\r
return true;\r
}\r
\r
/// <param name="spriteBatch">The widget.</param>\r
void Draw(SpriteBatch spriteBatch);\r
\r
+ /// <summary>\r
+ /// Get whether or not the entity is collidable.\r
+ /// </summary>\r
+ bool IsCollidable { get; }\r
+\r
/// <summary>\r
/// Get the actual position.\r
/// </summary>\r
/// <summary>\r
/// Get and set the tilemap with its associated texture and tile\r
/// character to coordinate mappings. This effects what the map looks\r
- /// like when it is drawn.\r
+ /// like when it is drawn. You will need to reset any map instances\r
+ /// after setting a new tilemap. You should also set a tilemap before\r
+ /// instantiating any maps.\r
/// </summary>\r
public static Tilemap Tilemap;\r
\r
public Game Game { get { return game; } }\r
public MovementManager Motion { get { return mMotion; } }\r
public int PlayerIndex { get { return mPlayerIndex; } }\r
+ public bool IsCollidable { get { return true; } }\r
public Vector2 Position { get { return mMotion.Position; } }\r
public Point Coordinates { get { return mMotion.Coordinates; } \r
set\r
this.health -= amount;\r
}\r
\r
+ public bool IsCollidable { get { return true; } }\r
+\r
/// <summary>\r
/// Get the smoothed position.\r
/// </summary>\r
// No implementation needed.\r
}\r
\r
+ public bool IsCollidable\r
+ {\r
+ get { return false; }\r
+ }\r
+\r
public Vector2 Position\r
{\r
get { return Vector2.Zero; }\r
\r
public Point Coordinates\r
{\r
- get { return new Point(-1, -1); }\r
+ get { return mCoordinates; }\r
}\r
\r
#endregion\r