Beispiel #1
0
        public static AnimationSet getRectangleAnimSet(int width, int height)
        {
            Texture2D    text    = RectangleGenerator.filled(width, height);
            AnimationSet animSet = new AnimationSet();

            animSet.currentAnimation = animSet.leftWalk = animSet.rightWalk = new Animation(text, 1, 1, 0, 1);
            animSet.leftAttack       = animSet.rightAttack = new Animation(text, 1, 1, 0, 1);
            animSet.leftAttackRange  = animSet.rightAttackRange = animSet.leftAttack;
            return(animSet);
        }
        public static AnimationSet loadTurretAnimation(LoaderPackage p)
        {
            AnimationSet set        = new AnimationSet();
            String       baseString = "Turrets/" + p.sourceString + "/" + p.sourceString;

            set.rightAttack = set.leftAttack = pngToAnimation(baseString + "A.png", p.attackSprites, p.attackAnim);
            set.rightWalk   = set.leftWalk = pngToAnimation(baseString + ".png", p.walkSprites, p.walkAnim);
            if (p.hasSecondaryAnim)
            {
                set.rightAttackRange = pngToAnimation(baseString + rightAttackRange, p.rangeAttackSprites, p.rangeAttackAnim);
                set.leftAttackRange  = pngToAnimation(baseString + leftAttackRange, p.rangeAttackSprites, p.rangeAttackAnim);
            }
            else
            {
                set.rightAttackRange = set.rightAttack;
                set.leftAttackRange  = set.leftAttack;
            }

            set.currentAnimation = set.rightWalk;
            return(set);
        }