예제 #1
0
        public void VijandShot()
        {
            //shoot only bulletdelay resets
            if (bulletDelay >= 0)
            {
                bulletDelay--;
            }

            if (bulletDelay <= 0)
            {
                //create new bullet and position it front center of enemy ship.
                Kogel newKogel = new Kogel(kogel_texture);
                newKogel.Positie   = new Vector2(Positie.X + (texture.Width / 2 - 120) - (kogel_texture.Width / 2), Positie.Y + (texture.Height / 2) - (kogel_texture.Height / 2));
                newKogel.isVisible = true;

                if (bulletList.Count < 20)
                {
                    bulletList.Add(newKogel);
                }
            }
            if (bulletDelay == 0)
            {
                bulletDelay = 300;
            }
        }
예제 #2
0
        public void ShootUp()
        {
            if (bulletDelay >= 0)
            {
                bulletDelay--;
            }
            if (bulletDelay <= 0)
            {
                sound.raketSound.Play();
                Kogel newKogel = new Kogel(_textureKogelUp);
                newKogel.Positie   = new Vector2(positie.X, positie.Y - 70);
                newKogel.isVisible = true;

                if (bulletUpList.Count < 1000)
                {
                    bulletUpList.Add(newKogel);
                }
            }
            if (bulletDelay == 0)
            {
                bulletDelay = 10;
            }
        }
예제 #3
0
        public void Shoot()
        {
            if (bulletDelay >= 0)
            {
                bulletDelay--;
            }
            if (bulletDelay <= 0)
            {
                sound.shotingSound.Play();
                Kogel newKogel = new Kogel(_textureKogel);
                newKogel.Positie   = new Vector2(Positie.X + (_texture.Width / 2 + 120) - (_textureKogel.Width / 2), Positie.Y + (_texture.Height / 2) - (_textureKogel.Height / 2));
                newKogel.isVisible = true;

                if (bulletList.Count < 1000)
                {
                    bulletList.Add(newKogel);
                }
            }
            if (bulletDelay == 0)
            {
                bulletDelay = 10;
            }
        }