예제 #1
0
 public Enemy(OverWorld ow, Tile t, int f, int[] newpath, string name)
     : base(ow, t, f)
 {
     path_index = 0;
       path = newpath;
       Name = name;
 }
예제 #2
0
 /*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>();
 }
예제 #3
0
 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>();
 }
예제 #4
0
 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>();
 }
예제 #5
0
 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;
       }
 }
예제 #6
0
 public LockedDoor(OverWorld ow, Tile t, int f, TileMap newdestination, Door newsister, int newKeyID)
     : base(ow, t, f, newdestination, newsister)
 {
     keyID = newKeyID;
     locked = true;
 }
예제 #7
0
 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;
       }
 }
예제 #8
0
 // 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;
 }
예제 #9
0
 // the other constructor is better
 public LockedChest(OverWorld ow, Tile t, int newKeyID)
     : base(ow, t)
 {
     keyID = newKeyID;
     locked = true;
 }
예제 #10
0
 public NPC(OverWorld ow, Tile t, NPC_Type vtype)
     : base(ow, t, 2)
 {
     type = vtype;
 }
예제 #11
0
 public NPC(OverWorld ow, Tile t, int facing, NPC_Type vtype)
     : base(ow, t, facing)
 {
     type = vtype;
 }
예제 #12
0
 public Door(OverWorld ow, Tile t, int f, TileMap newdestination, Door newsister)
     : base(ow, t, f)
 {
     destination = newdestination;
       sister = newsister;
 }
예제 #13
0
 public Door(OverWorld ow, Tile t, int f, OverWorld newdestination, Door newsister)
     : base(ow, t, f)
 {
     destination = newdestination.OWmap;
       sister = newsister;
 }