public Enemy(OverWorld ow, Tile t, int f, int[] newpath, string name) : base(ow, t, f) { path_index = 0; path = newpath; Name = name; }
/*public TileMap(Tile[,] m) { Map = m; }*/ public TileMap(int[,] existingMap, bool[,] existingCollisionMap) { Map = new Tile[existingMap.GetLength(0), existingMap.GetLength(1)]; for (int x = 0; x < Map.GetLength(0); x++) { for (int y = 0; y < Map.GetLength(1); y++) { Map[x, y] = new Tile(existingCollisionMap[x, y], existingMap[x, y], Tile.calcID(x, y)); } } EntityList = new List<Entity>(); }
public TileMap(int[,] existingMap, int[,] existingCollisionMap) { Map = new Tile[existingMap.GetLength(0), existingMap.GetLength(1)]; for (int x = 0; x < Map.GetLength(0); x++) { for (int y = 0; y < Map.GetLength(1); y++) { Map[x, y] = new Tile(existingCollisionMap[x, y], existingMap[x, y], Tile.calcID(x, y)); //Console.Write(existingMap[x, y] + ", "); } //Console.Write("\n"); } EntityList = new List<Entity>(); }
public Entity(OverWorld ow, Tile t, int f) { overworld = ow; if (t.entity == null) { tile = t; t.entity = this; } else { //Console.Write("Error, attempted to make entity in occupied tile"); tile = null; } Facing = f; EntityAvatar = new List<Texture2D>(); }
public Tile getAdjacent(Tile t, int direction) { int x = t.getX(); int y = t.getY(); int dir = direction % 4; if (dir == 0 && (x - 1 >= 0)) return OWmap.getTile(x - 1, y); else if (dir == 1 && (y + 1 < OWmap.Map.GetLength(1))) return OWmap.getTile(x, y + 1); else if (dir == 2 && (x + 1 < OWmap.Map.GetLength(0))) return OWmap.getTile(x + 1, y); else if (dir == 3 && (y - 1 >= 0)) return OWmap.getTile(x, y - 1); else { return null; } }
public LockedDoor(OverWorld ow, Tile t, int f, TileMap newdestination, Door newsister, int newKeyID) : base(ow, t, f, newdestination, newsister) { keyID = newKeyID; locked = true; }
protected bool MoveTo(Tile t) { //does not check collision with player, check before you call it if (t != tile && t.entity == null) { t.entity = this; tile.entity = null; tile = t; return true; } else { return false; } }
// the other constructor is better public LockedChest(OverWorld ow, Tile t, int gold_amount, List<Item> item_list, int newKeyID) : base(ow, t, gold_amount, item_list) { keyID = newKeyID; locked = true; }
// the other constructor is better public LockedChest(OverWorld ow, Tile t, int newKeyID) : base(ow, t) { keyID = newKeyID; locked = true; }
public NPC(OverWorld ow, Tile t, NPC_Type vtype) : base(ow, t, 2) { type = vtype; }
public NPC(OverWorld ow, Tile t, int facing, NPC_Type vtype) : base(ow, t, facing) { type = vtype; }
public Door(OverWorld ow, Tile t, int f, TileMap newdestination, Door newsister) : base(ow, t, f) { destination = newdestination; sister = newsister; }
public Door(OverWorld ow, Tile t, int f, OverWorld newdestination, Door newsister) : base(ow, t, f) { destination = newdestination.OWmap; sister = newsister; }