Пример #1
0
        public override void Load()
        {
            _level = LevelFactory.Create(1);

            _weapon = WeaponFactory.Create(WeaponType.Sword);
            _weapon.Position = new Vector3(0.0f, 0.5f, 0.0f);
            _weapon.Direction = 0.0f;

            var canvasWidth = 400;
            var canvasHeight = 500;
            _menuCanvas = new Canvas()
            {
                IsActive = true,
                Size = new Vector2(canvasWidth, canvasHeight),
                Position = new Vector2(((_graphics.GraphicsDevice.Viewport.Width / 2) - (canvasWidth / 2)), ((_graphics.GraphicsDevice.Viewport.Height / 2) - (canvasHeight / 2))),
                Hidden = true
            };
            _menuCanvas.Load(_content, _graphics);

            _txtbox = new TextBox
            {
                Font = "Verdana",
                Text = "Hi!",
                Name = "txtHi"
            };
            _txtbox.Load(_content, _graphics);

            _menuCanvas.AddChild(_txtbox);

            _archer = EnemyFactory.Create(EnemyType.Archer, 1);
            _archer.SetPosition(new Vector3(1.0f, 0.3f, 1.0f));

            _guard = EnemyFactory.Create(EnemyType.Guard, 1);
            _guard.SetPosition(new Vector3(-1.0f, 0.3f, 1.0f));

            _player.Position = new Vector3(0.0f, 0.35f, 0.0f);
        }
Пример #2
0
        public override void Unload()
        {
            _weapon.Unload();
            _level.Unload();

            _weapon = null;
            _level = null;
        }