Beispiel #1
0
 public Animation(Sprite _sprite)
 {
     sprite = _sprite;
     numImages = 0;
     curImage = 0;
     head = new ImageLink(sprite.image);
     current = head;
 }
Beispiel #2
0
 public Animation(Sprite _sprite)
 {
     sprite    = _sprite;
     numImages = 0;
     curImage  = 0;
     head      = new ImageLink(sprite.image);
     current   = head;
 }
Beispiel #3
0
        public void flipImage()
        {
            if (sprite != null)
            {

                if (curImage >= numImages - 1)
                {
                    current = head;
                    sprite.changeImage(current.image);
                    curImage = 0;
                }
                else
                {
                    current = current.next;
                    sprite.changeImage(current.image);
                    curImage++;
                }
            }
            else { }
        }
Beispiel #4
0
        public void addImage(Image _image)
        {
            if (head == null)
                head.image = _image;
            else
            {
                ImageLink newLink = new ImageLink(_image);

                ImageLink ptr = head;

                while (ptr.next != null)
                {
                    ptr = ptr.next;
                }

                ptr.next = newLink;
            }

            numImages++;
        }
Beispiel #5
0
 public void flipImage()
 {
     if (sprite != null)
     {
         if (curImage >= numImages - 1)
         {
             current = head;
             sprite.changeImage(current.image);
             curImage = 0;
         }
         else
         {
             current = current.next;
             sprite.changeImage(current.image);
             curImage++;
         }
     }
     else
     {
     }
 }
Beispiel #6
0
        public void addImage(Image _image)
        {
            if (head == null)
            {
                head.image = _image;
            }
            else
            {
                ImageLink newLink = new ImageLink(_image);

                ImageLink ptr = head;

                while (ptr.next != null)
                {
                    ptr = ptr.next;
                }

                ptr.next = newLink;
            }

            numImages++;
        }
Beispiel #7
0
 protected virtual void Initialize()
 {
     this.next = null;
     this.prev = null;
 }
Beispiel #8
0
 protected virtual void Initialize()
 {
     this.next = null;
     this.prev = null;
 }