示例#1
0
        public void ShootFireballFromMario()
        {
            if (this.Mario.IsFire())
            {
                float yPos = this.Mario.CurrentPosition.Y - this.Mario.Height / 3;
                float xPos = this.Mario.CurrentPosition.X;

                Fireball fireball = new Fireball(new Vector2(xPos, yPos), this.Mario.IsRightFacing());
                this.Projectiles.Add(fireball);
            }
        }
示例#2
0
 public FireballSprite(Fireball fireball)
 {
     this.Fireball     = fireball;
     this.TotalFrames  = SpriteHolder.FireballFrames;
     this.Texture      = SpriteHolder.Fireball;
     this.CurrentFrame = InitialFrame;
     this.ImgWidth     = this.Texture.Width / this.TotalFrames;
     this.ImgHeight    = this.Texture.Height;
     this.Height       = (int)(this.ImgHeight * ProjectileConfig.FireballHeightScale);
     this.Width        = (int)(this.ImgWidth * ProjectileConfig.FireballWidthScale);
 }
示例#3
0
        public void SpawnProjectile(Vector2 Position, String s)
        {
            IProjectile p;

            switch (s[1])
            {
            case 'S':
                p = new Shell(Position);
                this.level.Projectiles.Add(p);
                break;

            case 'F':
                p = new Fireball(Position, true);
                this.level.Projectiles.Add(p);
                break;
            }
        }
 public FireballCollisionResponder(Fireball fireball)
 {
     this.Fireball = fireball;
 }