예제 #1
0
        public virtual void Catched(Enemy sender)
        {
            Graphics g = CreateGraphics();

            g.FillEllipse(Brushes.Red, 0, 0, Width, Height);
            g.FillEllipse(Brushes.Black, 20, 10, 5, 5);
            g.FillEllipse(Brushes.Transparent, 35, 20, 10, 5);


            _Catched = true;

            Pacman_Messages?.Invoke(this, "Pacman has been catched by an enemy.");
        }
예제 #2
0
        void Pacman_Pacman_Movement(object sender, Point location)
        {
            for (int i = 0; i <= _Dots.Length - 1; i++)
            {
                if (_Dots[i] == null)
                {
                    continue;
                }

                if (_Dots[i].Location.X >= location.X && _Dots[i].Location.X <= (location.X + (Width / 3)) && _Dots[i].Location.Y >= location.Y && _Dots[i].Location.Y <= ((Height / 3) + location.Y))
                {
                    (sender as Pacman).TotalPoints += _Dots[i].Points;
                    _Dots[i].Dispose();
                    _Dots[i] = null;
                }
            }

            if ((_Dots.Where(d => d != null).Count() < 1))
            {
                Pacman_Messages?.Invoke(this, "You win !!");
            }
        }