コード例 #1
0
 private Player()
 {
     _frames = new List<ImageUnit[]>();
     _keysImage = new ImageUnit[3];
     try
     {
         ImageUnit character = new ImageUnit(_characterImageName);
         for (int row = 0; row < RowFrame; row++)
         {
             ImageUnit[] tmp = new ImageUnit[ColFrame];
             for (int col = 0; col < ColFrame; col++)
             {
                 Rectangle rect = new Rectangle(col * Floor.ObjectSize, row * Floor.ObjectSize, Floor.ObjectSize, Floor.ObjectSize);
                 tmp[col] = character.GetSubImage(rect);
             }
             _frames.Add(tmp);
         }
         _keysImage[0] = MapObjectFactory.CreateMapObject(MapObjectType.YellowKey).Frames[0];
         _keysImage[1] = MapObjectFactory.CreateMapObject(MapObjectType.BlueKey).Frames[0];
         _keysImage[2] = MapObjectFactory.CreateMapObject(MapObjectType.RedKey).Frames[0];
     }
     catch (Exception e)
     {
         Console.WriteLine(e.ToString());
     }
 }
コード例 #2
0
 private MonsterBook()
 {
     _background = new ImageUnit("DialogueBackground");
     _background.SetPosition(Floor.StartX, 0);
     _leftArrow = new ImageUnit("LeftArrow");
     _leftArrow.SetPosition(Floor.StartX + 5 * Floor.ObjectSize, Floor.ObjectSize * 11);
     _rightArrow = new ImageUnit("RightArrow");
     _rightArrow.SetPosition(Floor.StartX + 6 * Floor.ObjectSize, Floor.ObjectSize * 11);
 }
コード例 #3
0
 private Dialogue(DialogueLocation dialogueLocation, string nameTitle, string message, FaceLoaction faceLocation, string faceName)
 {
     _nameTitle = nameTitle;
     _message = message;
     _dialogueLocation = dialogueLocation;
     _faceLoaction = faceLocation;
     _faceImage = faceName != null ? new ImageUnit(faceName) : null;
     _background = new ImageUnit(BackgroundImageName);
 }
コード例 #4
0
ファイル: Shop.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Shop(string titleText, string[] menuText, Player player, Applet.Shop shop)
 {
     _shop = shop;
     _player = player;
     _menuText = menuText;
     _titleText = titleText;
     _background = new ImageUnit(BackgroundImageName);
     _choiceBackground = new ImageUnit(ChoiceBackgroundImageName);
     _currentChoice = 0;
 }
コード例 #5
0
 static MapObjectFactory()
 {
     ImageUnit img = new ImageUnit(FloorImageName);
     _objectInCol = img.Width / Floor.ObjectSize;
     _objectInRow = img.Height / Floor.ObjectSize;
     _dataSet = new List<List<ImageUnit>>();
     for (int row = 0; row < _objectInRow; row++)
     {
         if (row <= 7) // Item
         {
             for (int col = 0; col < _objectInCol; col++)
             {
                 Rectangle rect = new Rectangle(col * Floor.ObjectSize, row * Floor.ObjectSize, Floor.ObjectSize, Floor.ObjectSize);
                 _dataSet.Add(new List<ImageUnit>() { img.GetSubImage(rect) });
             }
         }
         else if (row == 8) // Shop
         {
             List<ImageUnit> frames = new List<ImageUnit>();
             for (int col = 0; col < 2; col++)
             {
                 Rectangle rect = new Rectangle(col * Floor.ObjectSize, row * Floor.ObjectSize, Floor.ObjectSize, Floor.ObjectSize);
                 frames.Add(img.GetSubImage(rect));
             }
             // TODO: Set Shop
             _dataSet.Add(frames);
             for (int col = 2; col < 4; col++)
             {
                 Rectangle rect = new Rectangle(col * Floor.ObjectSize, row * Floor.ObjectSize, Floor.ObjectSize, Floor.ObjectSize);
                 _dataSet.Add(new List<ImageUnit>() { img.GetSubImage(rect) });
             }
         }
         else // NPC & Monster
         {
             List<ImageUnit> frames = new List<ImageUnit>();
             for (int col = 0; col < _objectInCol - 1; col++)
             {
                 Rectangle rect = new Rectangle(col * Floor.ObjectSize, row * Floor.ObjectSize, Floor.ObjectSize, Floor.ObjectSize);
                 frames.Add(img.GetSubImage(rect));
             }
             _dataSet.Add(frames);
         }
     }
 }
コード例 #6
0
ファイル: Item.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Item(ImageUnit img, MapObjectType type)
     : base(img, type)
 {
 }
コード例 #7
0
 private Battle()
 {
     _background = new ImageUnit(BackgroundImageName);
     _background.SetPosition(Floor.StartX, 150);
     _active = false;
 }
コード例 #8
0
ファイル: Shop.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Shop(ImageUnit img, MapObjectType type)
     : base(img, type)
 {
     _shop = Applet.Shop.GetInstance();
 }
コード例 #9
0
 public MapObject(ImageUnit img, MapObjectType type)
     : this(new List<ImageUnit>() { img }, type)
 {
 }