using System;
using System.Collections.Generic;
using System.Text;
using HumanLikeBattleRobots.Graphic;

namespace HumanLikeBattleRobots.Logic
{
    class Cannonball: Bullet
    {
        private CannonballShadowSprite shadow;

        public Cannonball(Vec2f position, Vec2f speed, bool enemyBullet)
            : base(position, speed, enemyBullet)
        {
            bulletSprite = new CannonballSprite(2);
            shadow = new CannonballShadowSprite(0);
        }

        public Cannonball(Vec2f position, Vec2f speed, bool enemyBullet, float zSpeed)
            : this(position, speed, enemyBullet)
        {
            this.zSpeed = zSpeed; 
        }

        public override void Proceed(double delta)
        {
            base.Proceed(delta);
            shadow.Position = this.position + new Vec2f(0, this.zPosition*40);
        }

        public override void Draw()
        {
            (bulletSprite as CannonballSprite).Height = this.zPosition;
            bulletSprite.Draw();
        }

        public void DrawShadow()
        {
            shadow.Draw();
        }
    }
}
