Пример #1
0
 public void Fill(SpriteSource source)
 {
     for (int y = 0; y < Height; y++)
     {
         for (int x = 0; x < Width; x++)
         {
             _screenMap[x, y] = source;
         }
     }
 }
Пример #2
0
        public SpriteSet()
        {
            var fruit = new Dictionary <Fruit, SpriteSource>();

            for (int i = 0; i < 8; i++)
            {
                fruit[(Fruit)i] = new SpriteSource(i * 2, 10, 2);
            }

            Fruit = fruit;

            Blank     = new SpriteSource(0, 6, 1);
            Pill      = new SpriteSource(16, 0, 1);
            PowerPill = new SpriteSource(20, 0, 1);

            _blueMapPieces  = MapSet(0);
            _whiteMapPieces = MapSet(26);

            _characters[TextColour.White]  = CharacterColour(1);
            _characters[TextColour.Red]    = CharacterColour(24);
            _characters[TextColour.Pink]   = CharacterColour(26);
            _characters[TextColour.Cyan]   = CharacterColour(28);
            _characters[TextColour.Orange] = CharacterColour(30);
            _characters[TextColour.Peach]  = CharacterColour(34);
            _characters[TextColour.Yellow] = CharacterColour(36);

            TestBox = new List <SpriteSource>
            {
                new SpriteSource(30, 1, 1),
                new SpriteSource(28, 1, 1),
                new SpriteSource(31, 1, 1),
                new SpriteSource(29, 1, 1),
            }.AsReadOnly();

            BonusScores = new Dictionary <Fruit, ReadOnlyCollection <SpriteSource> >
            {
                [GameItems.Fruit.Cherry100]     = BonusSet(1, 5),
                [GameItems.Fruit.Strawberry300] = BonusSet(2, 5),
                [GameItems.Fruit.Orange500]     = BonusSet(3, 5),
                [GameItems.Fruit.Bell700]       = BonusSet(4, 5),
                [GameItems.Fruit.Apple1000]     = BonusSet(6, 13, 14),
                [GameItems.Fruit.Grapes2000]    = BonusSet(7, 8, 13, 14),
                [GameItems.Fruit.Arcadian3000]  = BonusSet(9, 10, 13, 14),
                [GameItems.Fruit.Key5000]       = BonusSet(11, 12, 13, 14)
            };
        }
Пример #3
0
        private Dictionary <char, SpriteSource> CharacterColour(int yAdd)
        {
            var chars = new Dictionary <char, SpriteSource>();

            for (var c = 'A'; c <= 'Z'; c++)
            {
                chars[c] = new SpriteSource(c - 64, 1 + yAdd, 1);
            }
            for (var c = '0'; c <= '9'; c++)
            {
                chars[c] = new SpriteSource(c - 32, yAdd, 1);
            }
            chars['!'] = new SpriteSource(27, 1 + yAdd, 1);
            chars['c'] = new SpriteSource(28, 1 + yAdd, 1);
            chars['p'] = new SpriteSource(29, 1 + yAdd, 1);
            chars['t'] = new SpriteSource(30, 1 + yAdd, 1);
            chars['s'] = new SpriteSource(31, 1 + yAdd, 1);
            chars['/'] = new SpriteSource(26, yAdd, 1);
            chars['-'] = new SpriteSource(27, yAdd, 1);
            chars['"'] = new SpriteSource(6, yAdd, 1);
            chars['.'] = new SpriteSource(5, yAdd, 1);
            return(chars);
        }
Пример #4
0
 public SpriteDisplay(Location location, SpriteSource sprite)
 {
     Location = location;
     Sprite   = sprite;
 }
Пример #5
0
 public void Update(SpriteSource sprite, int x, int y)
 {
     _screenMap[x, y] = sprite;
 }
Пример #6
0
 public void AddSprite(SpriteSource sprite, Location location)
 {
     _sprites.Add(new SpriteDisplay(location, sprite));
 }