Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 private static void Register(PlayerUnitType unitType, PlayerUnitTextureBank textureBank)
 {
     Textures.Add(unitType, textureBank);
 }