示例#1
0
        /// <summary>
        /// Moves a sprite right by default one unit.
        /// <para>Recursively calls itself if i > 1</para>
        /// </summary>
        /// <param name="s">The sprite to move.</param>
        /// <param name="i">Moves the sprite x times right.</param>

        public void Right(SkorkSprite s, int i = 1)
        {
            if (s.Location.X + 1 < 0 && i > 0)
            {
                s.Location = new Point(s.Location.X + 1, s.Location.Y);
                Right(s, --i);
            }
            else
            {
                return;
            }
        }
示例#2
0
        /// <summary>
        /// Moves a sprite up by default one unit.
        /// <para>Recursively calls itself if i > 1</para>
        /// </summary>
        /// <param name="s">The sprite to move.</param>
        /// <param name="i">Moves the sprite x times up.</param>

        public void Up(SkorkSprite s, int i = 1)
        {
            if (s.Location.Y + 1 < 0 && i > 0)
            {
                s.Location = new Point(s.Location.X, s.Location.Y + 1);
                Up(s, --i);
            }
            else
            {
                return;
            }
        }
示例#3
0
        /// <summary>
        /// Moves a sprite left by default one unit.
        /// <para>Recursively calls itself if i > 1</para>
        /// </summary>
        /// <param name="s">The sprite to move.</param>
        /// <param name="i">Moves the sprite x times left.</param>

        public void Left(SkorkSprite s, int i = 1)
        {
            if (s.Location.X - 1 < 0 && i > 0)
            {
                s.Location = new Point(s.Location.X - 1, s.Location.Y);
                Left(s, --i);
            }
            else
            {
                return;
            }
        }
示例#4
0
        /// <summary>
        /// Moves a sprite down by default one unit.
        /// <para>Recursively calls itself if i > 1</para>
        /// </summary>
        /// <param name="s">The sprite to move.</param>
        /// <param name="i">Moves the sprite i times down.</param>

        public void Down(SkorkSprite s, int i = 1)
        {
            if (s.Location.Y - 1 < 0 && i > 0)
            {
                s.Location = new Point(s.Location.X, s.Location.Y - 1);
                Down(s, --i);
            }
            else
            {
                return;
            }
        }
示例#5
0
        /// <summary>
        /// Moves a sprite left by default one unit.
        /// <para>Recursively calls itself if X > 1</para>
        /// </summary>
        /// <param name="s">The sprite to move.</param>
        /// <param name="x">Moves the sprite x times left.</param>

        public void left(SkorkSprite s, int x = 1)
        {
            if (s.Location.X - 1 < 0 && x > 0)
            {
                s.Location = new Point(s.Location.X - 1, s.Location.Y);
                left(s, --x);
            }
            else
            {
                return;
            }
        }
示例#6
0
 public void up(SkorkSprite s, int x = 1)
 {
     if (s.Location.Y + 1 < 0 && x > 0)
     {
         s.Location = new Point(s.Location.X, s.Location.Y + 1);
         System.Windows.Forms.MessageBox.Show("UP " + x);
         up(s, --x);
     }
     else
     {
         return;
     }
 }
示例#7
0
 public void down(SkorkSprite s, int x = 1)
 {
     if (s.Location.Y - 1 < 0 && x > 0)
     {
         s.Location = new Point(s.Location.X, s.Location.Y - 1);
         System.Windows.Forms.MessageBox.Show("DOWN " + x);
         down(s, --x);
     }
     else
     {
         return;
     }
 }
示例#8
0
 public void right(SkorkSprite s, int x = 1)
 {
     if (s.Location.X + 1 < 0 && x > 0)
     {
         s.Location = new Point(s.Location.X + 1, s.Location.Y);
         System.Windows.Forms.MessageBox.Show("RIGHT " + x);
         right(s, --x);
     }
     else
     {
         return;
     }
 }