コード例 #1
0
ファイル: Mob.cs プロジェクト: GinJou89/Bomberman
        private void MoveMob(Point newPlace)
        {
            int sx = 0; int sy = 0;

            if (mobPlace.X < newPlace.X)
            {
                sx = newPlace.X - mobPlace.X > step ? step : newPlace.X - mobPlace.X;
            }
            else
            {
                sx = mobPlace.X - newPlace.X < step ? newPlace.X - mobPlace.X: -step;
            }

            if (mobPlace.Y < newPlace.Y)
            {
                sy = newPlace.Y - mobPlace.Y > step ? step : newPlace.Y - mobPlace.Y;
            }
            else
            {
                sy = newPlace.Y - mobPlace.Y < step ? newPlace.Y - mobPlace.Y : -step;
            }
            moving.Move(sx, sy);

            mobPlace = moving.MyCurrentPossition();
            if (level >= 2 &&
                map[newPlace.X, newPlace.Y] == Sost.бомба ||
                map[newPlace.X, newPlace.Y] == Sost.огонь)
            {
                GetNewPlace();
            }
        }
コード例 #2
0
ファイル: Mob.cs プロジェクト: GinJou89/Bomberman
 public Mob(PictureBox picMob, PictureBox[,] _mapPic, Sost[,] _map, Player _player)
 {
     mob         = picMob;
     map         = _map;
     player      = _player;
     fmap        = new int[map.GetLength(0), map.GetLength(1)];
     path        = new Point[map.GetLength(0) * map.GetLength(1)];
     moving      = new MovingClass(picMob, _mapPic, _map, addBonus);
     mobPlace    = moving.MyCurrentPossition();
     destinPlace = mobPlace;
     CreateTimer();
     timer.Enabled = true;
 }
コード例 #3
0
ファイル: Player.cs プロジェクト: GinJou89/Bomberman
 public Point MycurrentPossion()
 {
     return(moving.MyCurrentPossition());
 }