Example #1
0
        public Enemy(int id, string name, int x, int y, ContentManager content)
        {
            ID       = id;
            Name     = name;
            X        = x;
            Y        = y;
            Position = new Vector(x, y);
            Type     = EntityType.None;
            Alive    = true;


            Animations = new List <Animation>();
            ViewField  = new Point[4];



            State = 1;

            XmlSerializer ax = new XmlSerializer(typeof(SpriteTable));

            using (Stream file = TitleContainer.OpenStream("Content/Sprites/" + name + ".xml"))
            {
                SpriteTable = (SpriteTable)ax.Deserialize(file);
            }


            Load(content);
        }
Example #2
0
        public Player(int id, string name, string clss, int x, int y, int fov, ContentManager content)
        {
            ID    = id;
            Name  = name;
            Class = clss;
            X     = x;
            Y     = y;

            Animations      = new List <Animation>();
            ExtraAnimations = new List <Animation>();

            XmlSerializer ax = new XmlSerializer(typeof(SpriteTable));

            Anim      = 0;
            Action    = false;
            FieldView = new FieldView(fov, true);


            using (Stream file = TitleContainer.OpenStream("Content/Sprites/" + name + ".xml"))
            {
                SpriteTable = (SpriteTable)ax.Deserialize(file);
            }

            using (Stream file = TitleContainer.OpenStream("Content/Interface/" + name + ".xml"))
            {
                CaraTable = (SpriteTable)ax.Deserialize(file);
            }


            Load(content);
        }
        internal PixelProcessingUnitContext(IRandomAccessMemory mainMemory)
        {
            _mainMemory = mainMemory;

            _stateMachine = new PPUStateMachine(this);

            SpriteTable       = new SpriteTable();
            _spritesToBeDrawn = new List <Sprite>();

            FirstTileMap  = new byte[32 * 32];
            SecondTileMap = new byte[32 * 32];
            TileData      = new byte[6144];

            _screenBuffer0 = new byte[Common.Constants.Video.ScreenWidth * Common.Constants.Video.ScreenHeight * 3];
            _screenBuffer1 = new byte[Common.Constants.Video.ScreenWidth * Common.Constants.Video.ScreenHeight * 3];

            LcdControl = 0x91;
        }
Example #4
0
        private void button5_Click(object sender, EventArgs e)
        {
            SpriteTable           = new SpriteTable();
            SpriteTable.Name      = textBox1.Text;
            SpriteTable.Sequences = new List <Sequence>();
            if (numericUpDown4.Value >= 1)
            {
                SpriteTable.Sequences.Add(new Sequence());
                SpriteTable.Sequences[0].Name   = "Idle";
                SpriteTable.Sequences[0].Frames = new List <Frame>();
                SpriteTable.Sequences[0].Frames.Add(new Frame());
            }
            if (numericUpDown4.Value >= 2)
            {
                SpriteTable.Sequences.Add(new Sequence());
                SpriteTable.Sequences[1].Name   = "Walk";
                SpriteTable.Sequences[1].Frames = new List <Frame>();
                SpriteTable.Sequences[1].Frames.Add(new Frame());
            }

            SoldierTactics.SpriteTable.Serialize(AppDomain.CurrentDomain.BaseDirectory + "/Content/Sprites/"
                                                 + textBox1.Text + ".xml", SpriteTable);
        }