예제 #1
0
        public PlayerUnitTextureBank MakeCopy()
        {
            PlayerUnitTextureBank copyBank = new PlayerUnitTextureBank();

            foreach (PlayerUnitAnimationType animationType in _animations.Keys)
            {
                SpriteAnimation animationCopy = _animations[animationType].GetFreshCopy();
                copyBank.AddAnimation(animationType, animationCopy);
            }
            return(copyBank);
        }
예제 #2
0
        private static void CreateTestSoldier()
        {
            var bank = new PlayerUnitTextureBank();

            Spritesheet     ss   = AssetRegistry.TEST_ENTITY;
            SpriteAnimation idle = new SpriteAnimation()
                                   .SetLoop(true)
                                   .SetPingPong(true);

            idle.AddFrame(ss.GetSpriteAt(0, 0), 200);
            idle.AddFrame(ss.GetSpriteAt(1, 0), 200);
            idle.AddFrame(ss.GetSpriteAt(2, 0), 200);
            bank.AddAnimation(PlayerUnitAnimationType.Idle, idle);

            Register(PlayerUnitType.TestSoldier, bank);
        }
예제 #3
0
 private static void Register(PlayerUnitType unitType, PlayerUnitTextureBank textureBank)
 {
     Textures.Add(unitType, textureBank);
 }