Пример #1
0
        public new void Move(MovementWay way)
        {
            switch (way)
            {
            case MovementWay.Up:
                Location = new Point(Location.X, Location.Y - Speed);
                break;

            case MovementWay.Down:
                Location = new Point(Location.X, Location.Y + Speed);
                break;

            case MovementWay.Left:
                Location = new Point(Location.X - Speed, Location.Y);
                break;

            case MovementWay.Right:
                Location = new Point(Location.X + Speed, Location.Y);
                break;
            }

            if (_pacman != null)
            {
                Enemy_Movement(this, Location);
                return;
            }

            Enemy_Movement?.Invoke(this, Location);
        }
Пример #2
0
        public new void Move(MovementWay way)
        {
            switch (way)
            {
            case MovementWay.Up:
                this.Location = new System.Drawing.Point(this.Location.X, this.Location.Y - Speed);
                break;

            case MovementWay.Down:
                this.Location = new System.Drawing.Point(this.Location.X, this.Location.Y + Speed);
                break;

            case MovementWay.Left:
                this.Location = new System.Drawing.Point(this.Location.X - Speed, this.Location.Y);
                break;

            case MovementWay.Right:
                this.Location = new System.Drawing.Point(this.Location.X + Speed, this.Location.Y);
                break;
            }

            Enemy_Movement?.Invoke(this, this.Location);
        }