Ejemplo n.º 1
0
        /// <summary>
        /// CONSTRUTOR
        /// </summary>
        /// <param name="level">Fase corrente</param>
        /// <param name="startPosition">Posição inicial</param>
        protected Character(Level level, Vector2 startPosition)
        {
            this.animatedSprite = new AnimatedSprite();

            // Fase corrente
            this.currentLevel = level;

            // Posição inicial do personagem
            this.Position = startPosition;

            // Carrega os conteúdos do personagem
            this.LoadContent();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Carrega a próxima fase
        /// </summary>
        private void LoadNextLevel()
        {
            // Fim do jogo
            if (this.levelIndex == NUMBER_LEVELS)
            {
                this.isEndGame = true;
            }
            // Inicializa a próxima fase do game
            else
            {
                // Gera a próxima fase de acordo com o contador
                this.level = new Level(this.ScreenManager.Game.Services, this.ScreenManager.GraphicsDevice.Viewport, this.GetLevelName(this.levelIndex++));

                // Atribui o comprimento da fase corrente para o controle de câmera
                this.camera.HorizontalLength = this.level.HorizontalLength;
                this.camera.VerticalLength = this.level.VerticalLenght;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// CONSTRUTOR
 /// </summary>
 public Player(Level level, Vector2 startPosition)
     : base(level, startPosition)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// CONSTRUTOR
 /// </summary>
 public Monster(Level level, Vector2 startPosition)
     : base(level, startPosition)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// CONSTRUTOR
 /// </summary>
 public Monster(Level level, Vector2 startPosition)
     : base(level, startPosition)
 {
     // Tempo para atualizar o monstro
     this.timeUpdateMonster = 0;
 }