public HomingRocketXna(PlanesGame game, HomingRocket bullet, CoordinatesTransformer coordinatesTransformer)
            : base(game, bullet, coordinatesTransformer)
        {
            var sound = game.GameManager.GameWorldXna.SoundManager.CreateBasicSoundEffect("bullet_sound");

            sound.Position = bullet.Position;
            sound.Play();

            m_trailDrawer = new TrailDrawer(game.Content.Load <Texture2D>("Other/line_3px"), coordinatesTransformer, Color.White, 0.3, 0.2f, 0.05f, 15, 3);
        }
Exemple #2
0
    void Sequence1()     // guided (missle)
    {
        followCannonIndex = followCannonIndex % 2;

        for (int i = 0; i < 4; i++)
        {
            int        index    = (followCannonIndex == 0 ? i : i + 4);
            Quaternion rotation = transform.rotation * Quaternion.AngleAxis(followCannonIndex == 0 ? 90 : -90, Vector3.up);

            Transform    inst   = (Transform)Instantiate(homingRocketPrefab, followCannonTransforms[index].position, rotation);
            HomingRocket rocket = inst.GetComponent <HomingRocket>();
            rocket.originObject  = transform;
            rocket.target        = targetTransform;
            rocket.bulletSpeed   = 10;
            rocket.ignoreCleaner = true;
        }

        Functions.PlayAudioClip(transform.position, shootSound);
        followCannonIndex++;
    }