Exemplo n.º 1
0
 public override void loadContent(ContentManager content)
 {
     background = content.Load <Texture2D>("maps/map1_1");
     Mario.loadContent(content);
     Brick.loadContent(content);
     ItemBlock.loadContent(content);
     FireBall.loadContent(content);
     Item.loadContent(content);
     Enemy.loadContent(content);
 }
Exemplo n.º 2
0
        public void addFireBall(GameTime gameTime)
        {
            FireBall newFireBall;

            if (mario.movingRight)
            {
                newFireBall = new FireBall(mario.positionRectangle.Right + 10, mario.positionRectangle.Center.Y, gameTime, true);
            }
            else
            {
                newFireBall = new FireBall(mario.positionRectangle.Left - 10, mario.positionRectangle.Center.Y, gameTime, false);
            }
            sprites.Add(newFireBall);
        }
Exemplo n.º 3
0
        public FireballEnemyHandler(CollisionObject collision, Level level)
        {
            if (collision.LeftSlot is FireBall)
            {
                fireBall = (FireBall)collision.LeftSlot;
                enemy    = (IEnemy)collision.RightSlot;
            }
            else
            {
                fireBall = (FireBall)collision.RightSlot;
                enemy    = (IEnemy)collision.LeftSlot;
            }
            commandList = new List <ICommand>();

            commandList.Add(new DeleteObjectCommand(level, fireBall));
            commandList.Add(new StompEnemyCommand(level, enemy));
        }
        public FireballBlockHandler(CollisionObject collision, Level level)
        {
            if (collision.LeftSlot is FireBall)
            {
                fireBall = (FireBall)collision.LeftSlot;
            }
            else
            {
                fireBall = (FireBall)collision.RightSlot;
            }
            direction   = (int)collision.CollisionType;
            commandList = new List <ICommand>();

            if (direction == 0)
            {
                commandList.Add(new DeleteObjectCommand(level, fireBall));
            }
            if (direction == 1)
            {
                commandList.Add(new DeleteObjectCommand(level, fireBall));
            }
        }