/// <summary>
 /// Execute after clicking Record
 /// </summary>
 public void OnRecord()
 {
     Fireworks.SwitchRecord();
     Bubble.SwitchRecord();
     Boom.SwitchRecord();
     Store.Regime = Store.TestRegime.Record;
 }
Exemple #2
0
    public override async void _Ready()
    {
        _crystal        = GetNode <Character>("Crystal");
        _waveSpawner    = GetNode <WaveSpawner>("WaveSpawner");
        _enemyContainer = _waveSpawner.GetEnemyContainer();
        _moneyNode      = GetNode <MoneyNode>("Hud/Money");
        _global         = GetTree().Root.GetNode <Global>("Global");
        _sceneChanger   = GetTree().Root.GetNode <SceneChanger>("SceneChanger");
        _jumpScreen     = GetNode <JumpScreen>("JumpScreen");
        _fireworks      = GetNode <Fireworks>("Fireworks");
        _deathScreen    = GetNode <DeathScreen>("DeathScreen");
        _musicPlayer    = GetNode <BattleGroundMusicPlayer>("BattleGroundMusicPlayer");

        _enemyContainer.Connect(nameof(EnemyContainer.Updated), this, nameof(_OnEnemyContainerUpdated));
        _enemyContainer.Connect(nameof(EnemyContainer.EnemyDeath), this, nameof(_OnEnemyDeath));

        _stateMachine     = new StateMachine();
        PauseState        = new PauseState(this, _stateMachine);
        PlayerAttackState = new PlayerAttackState(this, _stateMachine);

        _stateMachine.Initialize(PlayerAttackState);

        _jumpScreen.EnterAnimation();
        await ToSignal(_jumpScreen, nameof(JumpScreen.AnimationFinished));

        foreach (var effect in GetNode <HBoxContainer>("Hud/Effects").GetChildren())
        {
            (effect as Effect).Init(this);
        }

        Start(3, _global.Level);
    }
    private void Awake()
    {
        s_singleton = this;

        m_blueParticlesSystems = m_blueFireworks.GetComponentsInChildren <ParticleSystem>();
        m_redParticlesSystems  = m_redFireworks.GetComponentsInChildren <ParticleSystem>();
    }
 // Use this for initialization
 void Start()
 {
     level        = 0;
     audiomanager = (AudioManagerWall)GameObject.FindObjectOfType <AudioManagerWall>();
     gamemanager  = FindObjectOfType <GameManagerWall>();
     fireworks    = GameObject.Find("Fireworks").GetComponent <Fireworks>();
     startAudio(0);
 }
 /// <summary>
 /// Execute after clicking Play
 /// </summary>
 virtual public void OnPlay()
 {
     Fireworks.SwitchPlay();
     Bubble.SwitchPlay();
     Boom.SwitchPlay();
     Store.Regime  = Store.TestRegime.Play;
     timeRemaining = 4.0f;
 }
 public virtual void Show(Queue <GraphicsRequest> requestQueue)
 {
     lock (Fireworks)
     {
         Fireworks.ForEach((f) =>
         {
             f.Show(requestQueue);
         });
     }
 }
        public virtual void Simulate(int numSteps = 1)
        {
            lock (Fireworks)
            {
                for (int j = 0; j < numSteps; j++)
                {
                    if (rng.NextDouble() <= LaunchProb)
                    {
                        lock (Fireworks)
                        {
                            double r = rng.NextDouble();

                            if (r > 0.75)
                            {
                                Fireworks.Add(new Firework2D(
                                                  new Vector2D(rng.Next(Width), Height),
                                                  new Vector2D(0, rng.Next(MaxVel, MinVel))));
                            }
                            else if (r > 0.1)
                            {
                                if (Sprites.Count > 0)
                                {
                                    Fireworks.Add(new SpriteFirework2D(
                                                      new Vector2D(rng.Next(Width), Height),
                                                      new Vector2D(0, rng.Next(MaxVel, MinVel)),
                                                      Sprites[rng.Next(0, Sprites.Count)]));
                                }
                                else
                                {
                                    Fireworks.Add(new Firework2D(
                                                      new Vector2D(rng.Next(Width), Height),
                                                      new Vector2D(0, rng.Next(MaxVel, MinVel))));
                                }
                            }
                        }
                    }

                    for (int i = Fireworks.Count - 1; i >= 0; i--)
                    {
                        if (Fireworks[i].Done())
                        {
                            Fireworks.RemoveAt(i);
                        }
                        else
                        {
                            Fireworks[i].Update();
                        }
                    }
                }
            }

            OnUpdateEvent();
        }
Exemple #8
0
 private void _Goal(int score)
 {
     m_score = score;
     GoalUI.ShowGoalUI();
     GalaxyAudioPlayer.PlayGoalSound();
     if (m_humanTeam)
     {
         Fireworks.UseBlueFireworks();
     }
     else
     {
         Fireworks.UseRedFireworks();
     }
 }
Exemple #9
0
    protected void CreateFirework()
    {
        if (FireworkObject == null)
        {
            return;
        }
        GameObject go        = Instantiate(FireworkObject) as GameObject;
        Fireworks  fireworks = go.GetComponent <Fireworks>();

        if (fireworks == null)
        {
            DestroyImmediate(go);
            return;
        }
        go.transform.parent        = transform;
        go.transform.localPosition = Vector3.zero;
    }
        public FireWorkz()
        {
            foreach (var file in Directory.GetFiles("./Content/Fireworks/"))
            {
                var firework = Image.FromFile(file);
                ImageAnimator.Animate(firework, null);

                Fireworks.Add(firework);
            }

            _random = new Random(DateTime.Now.Millisecond);

            for (var i = 0; i < FireworkPositions.Length; i++)
            {
                FireworkPositions[i] = GenerateFirework();
            }

            ResetTimer();
        }
Exemple #11
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            coinsCounts--;
            if (coinsCounts == 0)
            {
                Debug.Log("Has Ganado");
                GameObject GameManager = GameObject.Find("GameManager");
                Destroy(GameManager);
                GameObject[] FireWorksSystem = GameObject.FindGameObjectsWithTag("Fireworks");

                foreach (GameObject Fireworks in FireWorksSystem)
                {
                    Fireworks.GetComponent <ParticleSystem>().Play();
                }
            }
            Destroy(gameObject);
        }
    }
Exemple #12
0
    // Called when this enemy should die
    public void die(bool noDrop = false)
    {
        music_manager.Instance.die();
        // Make sure reticle is unparented
        UnParentOnDestroy retScript;

        if ((retScript = GetComponentInChildren <UnParentOnDestroy>()) != null)
        {
            retScript.gameObject.transform.parent = null;
        }

        // Camera shake
        CameraShakeScript CSS = Camera.main.GetComponent <CameraShakeScript> ();

        if (CSS != null)
        {
            if (noDrop)
            {
                CSS.activate(2, .5f);
            }
            else
            {
                CSS.activate(.6f, .3f);                //.3
            }
        }

        playExplosion();

        // Spawn drops
        if (GetComponent <bull4>())
        {
            for (int i = 0; i < 10; i++)
            {
                DropManager.Instance.SpawnRandDrop((Vector3)(Random.insideUnitCircle) * transform.localScale.x + transform.position);
            }

            GM.Instance.YouWin();
        }
        else if (guaranteeDrop)
        {
            DropManager.Instance.SpawnRandDrop(transform.position);
        }
        else if (!noDrop)
        {
            DropManager.Instance.MaybeDrop(maxHP, transform.position);
        }

        // If this is an asteroid (rock), blow up the whole thing
        Rock rock = GetComponent <Rock>();

        if (rock != null)
        {
            rock.asteroid.killTurrets();
        }

        // If this has fireworks enabled, explode with bullets!
        Fireworks boom = GetComponent <Fireworks>();

        if (boom != null && boom.enabled)
        {
            boom.Explode();
        }

        GM.Instance.Died(gameObject);
        // If this is a seeking missile, kill its root gameObject
        if (GetComponent <seeking_missile>())
        {
            Destroy(transform.root.gameObject);
        }
        else
        {
            Destroy(gameObject);
        }
    }
 public virtual void AddFireworkRange(ICollection <AFirework> fireworks)
 {
     Fireworks.AddRange(fireworks);
 }
 public virtual void AddFirework(AFirework firework)
 {
     Fireworks.Add(firework);
 }
 protected override void OnEnable()
 {
     instance = this;
     weaponPrefab.gameObject.SetActive(value: false);
     base.OnEnable();
 }
        private void fireworksDemo_Click(object sender, RoutedEventArgs e)
        {
            var fwW = new Fireworks();

            fwW.Show();
        }
 protected override void OnDisable()
 {
     base.OnDisable();
     instance = null;
 }