using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

using Tao.OpenGl;

namespace Log740
{
    class Bullet : Sphere
    {
        public Vecteur3F Speed;

        private int life;

        public Bullet(Vecteur3F color, Vecteur3F speed, int life)
            : base(color)
        {
            this.selectable = false;
            this.Speed = speed;
            this.life = life;
            this.size.X = 0.1;
            this.size.Y = 0.1;
            this.size.Z = 0.1;
        }

        public bool Dead
        {
            get
            {
                return this.life == 0;
            }
        }

        public int Life
        {
            get
            {
                return this.life;
            }
        }

        public void Kill()
        {
            this.life = 0;
        }

        protected override void AnimateInternal()
        {
            this.location += Speed;
            this.life -= 1;
        }
    }
}
