예제 #1
0
        /// <summary>
        /// Loads all content used by the player
        /// </summary>
        protected override void LoadContent()
        {
            // Hero
            var spriteSheet = Game.Content.Load<Texture2D>(@"BoyHeroWalk");
            var animations = new Dictionary<AnimationKey, PlayerAnimation>();

            var animation = new PlayerAnimation(new[]
                {
                    new Rectangle(0, 0, 16, 32),
                    new Rectangle(16, 0, 16, 32),
                    new Rectangle(32, 0, 16, 32)
                });
            animations.Add(AnimationKey.Down, animation);

            animation = new PlayerAnimation(new[]
                {
                    new Rectangle(0, 32, 16, 32),
                    new Rectangle(16, 32, 16, 32),
                    new Rectangle(32, 32, 16, 32)
                });
            animations.Add(AnimationKey.Up, animation);

            animation = new PlayerAnimation(new[]
                {
                    new Rectangle(0, 64, 16, 32),
                    new Rectangle(16, 64, 16, 32),
                    new Rectangle(32, 64, 16, 32)
                });
            animations.Add(AnimationKey.Left, animation);

            animation = new PlayerAnimation(new[]
                {
                    new Rectangle(0, 96, 16, 32),
                    new Rectangle(16, 96, 16, 32),
                    new Rectangle(32, 96, 16, 32)
                });
            animations.Add(AnimationKey.Right, animation);

            Sprite = new PlayerAnimatedSprite(spriteSheet, animations) {Position = new Vector2(96, 96)};

            TextPanel = new TextPanel(Game, 0, 0, true) {Visible = false};
            Components.Add(TextPanel);

            _pauseScreen = new Pause(Game, 0, 0);
            Components.Add(_pauseScreen);

            base.LoadContent();
        }
예제 #2
0
        public new void LoadContent()
        {
            Frame = Game.Content.Load<Texture2D>(@"BattleFrame");

            _background = new Background(Game, BackgroundType.Grass);
            DrawableComponents.Add(_background);

            DrawableComponents.Add(EnemyTrainer);
            DrawableComponents.Add(AlliedTrainer);

            ActiveAlliedPokemon.Visible = false;
            ActiveEnemyPokemon.Visible = false;
            DrawableComponents.Add(ActiveAlliedPokemon);
            DrawableComponents.Add(ActiveEnemyPokemon);

            _textPanel = new TextPanel(Game, 0, 110, false);
            DrawableComponents.Add(_textPanel);

            _allyPokemonPanel = new AllyPokemonPanel(Game) { Visible = false };
            DrawableComponents.Add(_allyPokemonPanel);

            _enemyPokemonPanel = new EnemyPokemonPanel(Game) { Visible = false };
            DrawableComponents.Add(_enemyPokemonPanel);

            _pokeballsAlly = new PokeballsAlly(Game, AlliedTrainer) { Visible = false };
            DrawableComponents.Add(_pokeballsAlly);

            _pokeballsEnemy = new PokeballsEnemy(Game, EnemyTrainer) { Visible = false };
            DrawableComponents.Add(_pokeballsEnemy);

            _attackChoiceArrow = new AttackChoiceArrow(Game) { Visible = false };
            _attackMenu = new AttackMenu(Game, _attackChoiceArrow, ActiveAlliedPokemon.PokemonInstance) { Visible = false };
            DrawableComponents.Add(_attackMenu);
            DrawableComponents.Add(_attackChoiceArrow);

            _actionChoiceArrow = new ActionChoiceArrow(Game) { Visible = false };
            _actionMenu = new ActionMenu(Game) { Visible = false };
            DrawableComponents.Add(_actionMenu);
            DrawableComponents.Add(_actionChoiceArrow);

            DrawableComponents.Add(_textPanel.BattleText);
        }