Esempio n. 1
0
 public Bomb(System.Drawing.Point p, TimeSpan ti, TypeOfBomb ty, MyMap map)
 {
     point = p;
     time = TimeSpan.FromMilliseconds(ti.TotalMilliseconds);
     type = ty;
     this.map = map;
     bomb_eff = new List<Image>();
     rect = new Image();
     Counter = 0;
     rect_eff = bomb_img[0];
     rect.Width = gridSize;
     rect.Source = rect_eff[Counter++];
     for (int i = 0; i < bomb_effects.Count; i++)
     {
         Image img = new Image();
         img.Source = bomb_effects[i];
         img.Height = gridSize;
         bomb_eff.Add(img);
     }
     startFrameCounter();
 }
Esempio n. 2
0
 public Bomb(System.Drawing.Point p, TimeSpan ti, TypeOfBomb ty, MyMap map)
 {
     point       = p;
     time        = TimeSpan.FromMilliseconds(ti.TotalMilliseconds);
     type        = ty;
     this.map    = map;
     bomb_eff    = new List <Image>();
     rect        = new Image();
     Counter     = 0;
     rect_eff    = bomb_img[0];
     rect.Width  = gridSize;
     rect.Source = rect_eff[Counter++];
     for (int i = 0; i < bomb_effects.Count; i++)
     {
         Image img = new Image();
         img.Source = bomb_effects[i];
         img.Height = gridSize;
         bomb_eff.Add(img);
     }
     startFrameCounter();
 }
Esempio n. 3
0
 private void LoadElements()
 {
     this.gridSize = Carrier.Width / numX;//确定地图格子大小
     Bomb.gridSize = this.gridSize;//
     testMap = new MyMap( numX, numY, (int)Carrier.Width, (int)Carrier.Height );
     person1 = new MyPerson( gridSize, source.personsource1.body, new System.Drawing.Point( 0, 0 ), testMap );
     testMap.personBlocks.Add( person1 );
     person2 = new MyPerson( gridSize, source.personsource2.body, new System.Drawing.Point( 15, 15 ), testMap );
     testMap.personBlocks.Add( person2 );
     person1.Width = person1.Height = gridSize;
     person2.Width = person2.Width = gridSize;
     person2.Faction.Fill = new SolidColorBrush( Colors.Blue );
     person2.Faction.Text = "主角2";
     LoadMap();//加载地图
     LoadPerson( person1 );
     person1.xspeed = 400;
     person1.yspeed = 400;
     LoadPerson( person2 );
     person2.xspeed = 400;
     person2.yspeed = 400;//加载人物
 }