示例#1
0
        public void SnaryadRun()
        {
            if (IsShuth)
            {
                if (snaryad == null)
                {
                    snaryad = new Snaryad(X, Y, currentDir, SnaryadV);
                }


                snaryad.Run();
                if (snaryad.X < 0 || snaryad.X > 500 || snaryad.Y < 0 || snaryad.Y > 500)
                {
                    IsShuth = false;
                    snaryad = null;
                }
            }
        }
示例#2
0
        public void Run()
        {
            PutCurrentImage();

            if (Dir == DirectionEnum.Up)
            {
                Y--;
            }
            else if (Dir == DirectionEnum.Down)
            {
                Y++;
            }
            else if (Dir == DirectionEnum.Right)
            {
                X++;
            }
            else
            {
                X--;
            }

            if (X % 40 == 0 && Y % 40 == 0)
            {
                Turn();
            }

            if (snaryad == null)
            {
                snaryad = new Snaryad(X, Y, Dir);
            }

            snaryad.Run();

            if (snaryad.X < 0 || snaryad.X > 500 || snaryad.Y < 0 || snaryad.Y > 500)
            {
                snaryad = null;
            }


            Transparent();
        }