예제 #1
0
 public void SetInvisible(List <Monster> monsterList)
 {
     foreach (Character monster in monsterList)
     {
         MyFoxDraw.SetPosition(MyFoxDraw.Items[monster.CharacterId], -500, -500);
     }
 }
예제 #2
0
 internal void MoveDown(Character character)
 {
     if ((character.TileNumber / WidthUnits != HeightUnits - 1) && !WallTiles.Contains(character.TileNumber + 10))
     {
         double x = MyFoxDraw.GetLeft(MyFoxDraw.Items[character.CharacterId]);
         double y = MyFoxDraw.GetTop(MyFoxDraw.Items[character.CharacterId]) + 50;
         MyFoxDraw.SetPosition(MyFoxDraw.Items[character.CharacterId], x, y);
         character.TileNumber += 10;
     }
 }
예제 #3
0
 internal void MoveUp(Character character)
 {
     if ((character.TileNumber / WidthUnits != 0) && !WallTiles.Contains(character.TileNumber - 10))
     {
         double x = MyFoxDraw.GetLeft(MyFoxDraw.Items[character.CharacterId]);
         double y = MyFoxDraw.GetTop(MyFoxDraw.Items[character.CharacterId]) - 50;
         MyFoxDraw.SetPosition(MyFoxDraw.Items[character.CharacterId], x, y);
         character.TileNumber -= 10;
     }
 }
예제 #4
0
 public void DrawMap()
 {
     for (int i = 0; i < HeightUnits; i++)
     {
         for (int j = 0; j < WidthUnits; j++)
         {
             if (WallTiles.Contains(WidthUnits * i + j))
             {
                 MyFoxDraw.AddImage("./Assets/wall.png", 50 * j, 50 * i);
             }
             else
             {
                 MyFoxDraw.AddImage("./Assets/floor.png", 50 * j, 50 * i);
             }
         }
     }
 }
예제 #5
0
 public void DrawCharacter(Character character)
 {
     MyFoxDraw.AddImage(character.ImageSource, ((character.TileNumber % WidthUnits) * 50), ((character.TileNumber / WidthUnits) * 50));
 }
예제 #6
0
 public void ResetPositionToZero(Character character)
 {
     MyFoxDraw.SetPosition(MyFoxDraw.Items[character.CharacterId], 0, 0);
     character.TileNumber = 0;
 }
예제 #7
0
 public void SetInvisible(Character character)
 {
     MyFoxDraw.SetPosition(MyFoxDraw.Items[character.CharacterId], -500, -500);
 }