Esempio n. 1
0
 private static void InnerSwitchToCategory(GameObject player, FrameCategory frameCategory)
 {
     if (!player.SpriteComponent.AnimationComponent.CurrentCategory.Equals((int)frameCategory))
     {
         player.SpriteComponent.AnimationComponent.CurrentCategory = (int)frameCategory;
         player.SpriteComponent.AnimationComponent.CurrentFrame    = 0;
     }
 }
Esempio n. 2
0
        private static List <Rectangle> ObtainFrameList(FrameCategory frameCategory, SpriteComponent spriteComponent, AnimationComponent animationComponent)
        {
            var result = new List <Rectangle>();

            var textureSizeModified = Constants.TILESIZE * spriteComponent.TextureModifier;

            for (int i = 0; i < animationComponent.FramesLength[(int)frameCategory]; i++)
            {
                Rectangle frame = new Rectangle(i * textureSizeModified, (int)frameCategory * textureSizeModified, textureSizeModified, textureSizeModified);
                result.Add(frame);
            }

            return(result);
        }
Esempio n. 3
0
 public FrameDescription(
     string frameId,
     string description,
     string shortDescription,
     FrameCategory category,
     FrameType type,
     FrameMeaning meaning)
 {
     FrameId          = frameId;
     Description      = description;
     ShortDescription = shortDescription;
     Category         = category;
     Type             = type;
     Meaning          = meaning;
 }
Esempio n. 4
0
 public static void SwitchToFrameCategory(AnimationComponent animationComponent, FrameCategory frameCategory)
 {
     if (!animationComponent.CurrentCategory.Equals((int)frameCategory))
     {
         animationComponent.CurrentCategory = (int)frameCategory;
         animationComponent.CurrentFrame    = 0;
     }
 }
Esempio n. 5
0
 public static void ExecuteFullAnimation(GameObject player, FrameCategory frameCategory)
 {
     player.SpriteComponent.AnimationComponent.FullAnimation = true;
     InnerSwitchToCategory(player, frameCategory);
     player.SpriteComponent.AnimationComponent.CurrentFrame = 0;
 }