Example #1
0
 private void TimerStart()
 {
     b_TimerStarted = true;
     TimerText.SetValue(CountDownTimer.CountDownSecondsProperty, i_TimeSet);
     TimerText.SetValue(CountDownTimer.CountDownMinutesProperty, 0);
     TimerText.TimerStart();
 }
Example #2
0
 private void TimerText_Tick(object sender, EventArgs e)
 {
     lblAgregados.Text    = "Se Agregaron";
     lblAgregados.Visible = false;
     txtChannel.Text      = "";
     TimerText.Stop();
 }
Example #3
0
 void Start()
 {
     is_timer_ienumerator = false;
     timer                = this.GetComponent <Timer>();
     is_timer_start       = false;
     tt                   = GameObject.Find("Timer_Score").GetComponent <TimerText>();
     is_timer_score_ended = false;
 }
Example #4
0
 //metodo para mostrar por 3 segundos los videos que se agregaron
 private void ShowLabel(int agregados)
 {
     lblAgregados.Text   += " " + agregados.ToString() + " Videos";
     lblAgregados.Visible = true;
     //txtChannel.Text = "Se agregaron " + agregados.ToString() +" Videos";
     TimerText.Start();
     ActLabels();
 }
Example #5
0
        private void OnDraw(EventArgs args)
        {
            if (!DrawGlobal.CurrentValue)
            {
                // Complete drawing turned off
                return;
            }

            foreach (var enemy in EntityManager.Heroes.Enemies.Where(o => !o.IsDead || o.IsInRange(EnemySpawnPoint, 250)))
            {
                // Get the minimap position
                var pos = enemy.ServerPosition.WorldToMinimap();

                if (LastSeen.ContainsKey(enemy.NetworkId))
                {
                    // Update the position
                    pos = LastSeenPosition[enemy.NetworkId].WorldToMinimap();

                    // Get the time being invisible in seconds
                    var invisibleTime = (Core.GameTickCount - LastSeen[enemy.NetworkId]) / 1000f;

                    // Predicted movement circle
                    if (DrawMovementCircle.CurrentValue)
                    {
                        // Get the radius the champ could have walked
                        var radius = LastSeenRange.ContainsKey(enemy.NetworkId) ? LastSeenRange[enemy.NetworkId] : (enemy.MoveSpeed > 1 ? enemy.MoveSpeed : 540) * invisibleTime;

                        // Don't roast toasters
                        if (radius < RangeCircleDisableRange.CurrentValue * 10)
                        {
                            Utilities.DrawCricleMinimap(pos, radius * Utilities.MinimapMultiplicator, Color.Red, 1, 500);
                        }
                    }

                    // Draw the minimap icon
                    ChampionSprites[enemy.Hero].Draw(pos + MinimapIconOffset);

                    // Draw the time being invisible
                    if (DrawInvisibleTime.CurrentValue && invisibleTime >= DelayInvisibleTime.CurrentValue)
                    {
                        var text     = Math.Floor(invisibleTime).ToString(CultureInfo.InvariantCulture);
                        var bounding = TimerText.MeasureBounding(text);
                        TimerText.Draw(text, TimerText.Color, pos - (new Vector2(bounding.Width, bounding.Height) / 2) + 1);
                    }
                }

                // Draw recall circle
                if (DrawRecallCircle.CurrentValue && RecallingHeroes.ContainsKey(enemy.NetworkId))
                {
                    var startTime = RecallingHeroes[enemy.NetworkId].Item1;
                    var duration  = RecallingHeroes[enemy.NetworkId].Item2;

                    Utilities.DrawArc(pos, (MinimapIconSize + 4) / 2f, Color.Aqua, 3.1415f, Utilities.PI2 * ((Core.GameTickCount - startTime) / (float)duration), 2f, 100);
                }
            }
        }
 // Start is called before the first frame update
 void Start()
 {
     AlienSprite     = GameObject.Find("Canvas/AlienCollection");    // Find AlienCollection
     alienCollection = AlienSprite.GetComponent <AlienCollection>(); // Set alienCollection to the found gameObject
     scoreSprite     = GameObject.Find("Canvas/Score");
     scoreAdder      = scoreSprite.GetComponent <ScoreAdder>();
     timer           = GameObject.Find("Canvas/Timer");
     timerText       = timer.GetComponent <TimerText>();
     s = Score.instance;
 }
Example #7
0
 // Start is called before the first frame update
 void Start()
 {
     total_score_text = this.GetComponent <Text>();
     ts  = GameObject.Find("Timer").GetComponent <TimerScore>();
     rui = GameObject.Find("Heart_Score").GetComponent <RemainUI>();
     tt  = GameObject.Find("Timer_Score").GetComponent <TimerText>();
     is_text_ienumerator  = false;
     is_score_ienumerator = false;
     is_end_typing        = false;
     score = 0;
 }
Example #8
0
    // Funçao que controla o tempo do minigame. Se chegar a 0, acaba o jogo e verifica se tem o score minimo.
    private void decreaseTimeRemaining()
    {
        timer--;
        TimerText timerText = GameObject.Find("Timer").GetComponent <TimerText> () as TimerText;

        timerText.setTime(timer);
        if (timer <= 0)
        {
            EndGame();
        }
    }
Example #9
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
Example #10
0
 private void Timer1_Tick(object sender, System.EventArgs e)
 {
     lblTimer.Text = TimerText.Replace("¤", SecondsLeft.ToString());
     SecondsLeft--;
     if (SecondsLeft > -1)
     {
         return;
     }
     timer1.Enabled = false;
     DialogResult   = DialogResult.OK;
 }
Example #11
0
    public void OutOccured()
    {
        GameChance = PlayerPrefs.GetInt("GameChances", 0);

        if (GameChance == 0 && Score > 30 && !(Application.internetReachability == NetworkReachability.NotReachable))
        {
            PlayerPrefs.SetInt("OutFlag", 1);
            PlayerPrefs.SetInt("GameChances", 1);
            GBall.SetActive(false);
            ContinueButton.SetActive(true);
            NoThanksButton.SetActive(true);
            BGMSoundRef.SetActive(false);
            TimerText.SetActive(true);
        }
        else
        {
            BGMSoundRef.SetActive(false);
            FlySoundRef.SetActive(false);

            Sound = PlayerPrefs.GetInt("Sound", 1);
            if (Sound == 1)
            {
                FindObjectOfType <OutSound>().OutSoundCall();
            }

            PlayerPrefs.SetInt("OutFlag", 1);
            ScoreText.text = "Out ";
            GBall.SetActive(false);
            OutExplotionP.SetActive(true);

            Games = Games + 1;
            PlayerPrefs.SetInt("Games", Games);

            if (Score > HighSpeed)
            {
                PlayerPrefs.SetInt("HighestSpeed", Score);
            }

            TotalScore = PlayerPrefs.GetInt("TotalScore", 0);
            TotalScore = TotalScore + Score;
            PlayerPrefs.SetInt("TotalScore", TotalScore);

            Level = TotalScore / 1000;
            PlayerPrefs.SetInt("Level", Level);
            AverageSpeed = TotalScore / Games;
            PlayerPrefs.SetInt("AverageSpeed", AverageSpeed);

            PlayerPrefs.SetInt("Score", Score);
            PlayerPrefs.SetInt("GameChances", 0);
            PlayerPrefs.SetInt("GameChanceScore", 0);

            Invoke("LoadMenuSceneFuntion", 1.67f);
        }
    }
Example #12
0
 private void Input_TextChanged(object sender, TextChangedEventArgs e)
 {
     try
     {
         answer = Convert.ToInt32(Input.Text.ToString());
     }
     catch (Exception)
     {
         TimerText.AppendText(Environment.NewLine);
         TimerText.AppendText("Wrong Input!");
     }
 }
Example #13
0
    private void InteractWithUsables()
    {
        foreach (UsableItem item in _usables)
        {
            item.Update(Time.deltaTime);

            //Used to update the timer
            TimerText _timer = null;
            switch (item.GetID())
            {
            case UsableID.MEDKIT:
                _timer = _applyingHealthText.GetComponentInChildren <TimerText>();
                break;

            case UsableID.DAMAGE:
                _timer = _applyingDamageText.GetComponentInChildren <TimerText>();
                break;

            case UsableID.RESISTANCE:
                _timer = _applyingResistanceText.GetComponentInChildren <TimerText>();
                break;

            case UsableID.SPEED:
                _timer = _applyingSpeedText.GetComponentInChildren <TimerText>();
                break;
            }

            //Get the remaining time
            float remainingTime = item.GetApplyTimeRemaining();

            //Updates the timer
            _timer.SetTimer(remainingTime);

            //Disables the object when the time has ran out
            if (remainingTime <= 0.0f)
            {
                _timer.gameObject.transform.parent.gameObject.SetActive(false);
            }
        }

        //Removes the finished items from the usables list
        foreach (UsableItem item in _itemsToRemoveThisFrame)
        {
            _usables.Remove(item);
        }

        _itemsToRemoveThisFrame.Clear();
    }
Example #14
0
 // Use this for initialization
 void Start()
 {
     maxCombo = 0;
     meters   = 0;
     lineRenderer.positionCount = 2;     // 2 points
     _spriteRenderer            = GetComponent <SpriteRenderer>();
     _spriteWidth              = _spriteRenderer.sprite.rect.width;
     isAlive                   = true;
     _timerUIScript            = TimerUI.GetComponent <TimerText>();
     _changeLineRendererScript = lineRenderer.GetComponent <ChangeColor>();
     _boxCollider              = GetComponent <BoxCollider2D>();
     _circleCollider           = GetComponent <CircleCollider2D>();
     _circleCollider.enabled   = false;
     _boxCollider.enabled      = true;
     SmokeParticleSystem.Stop();
     followCam.GetComponent <FollowCam>();
 }
Example #15
0
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(background, Position, Color.White);

            string seconds = TimeSpan.FromSeconds(scene.Timer.Counter).Seconds.ToString("00");
            string minutes = TimeSpan.FromSeconds(scene.Timer.Counter).Minutes.ToString("00");

            TimerText.Text     = minutes + ":" + seconds;
            LivesText.Text     = "Lives: " + scene.Player.Live.ToString();
            BlockLeftText.Text = "Block Left: " + scene.BlockLeft.ToString();

            AlignText(TimerText, Alignment.Center);
            AlignText(LivesText, Alignment.Left);
            AlignText(BlockLeftText, Alignment.Right);

            TimerText.Draw(spriteBatch);
            LivesText.Draw(spriteBatch);
            BlockLeftText.Draw(spriteBatch);
        }
Example #16
0
 public void button_Click_end(object sender, RoutedEventArgs e)
 {
     //Token to stop
     if (cts != null && number == answer)
     {
         cts.Cancel();
         cts.Dispose();
         cts = null;
         TimerText.AppendText(Environment.NewLine);
         TimerText.AppendText("YOU WIN!");
         timer.Interval = TimeSpan.FromMilliseconds(200);
         timer.Tick    += new EventHandler(OnTick);
         timer.Start();
     }
     else
     {
         TimerText.AppendText(Environment.NewLine);
         TimerText.AppendText("Try Again!");
     }
 }
Example #17
0
    // Update is called once per frame
    void Update()
    {
        if (timer > 0)
        {
            timer -= 1 * Time.deltaTime;
        }
        else
        {
            if (!gameOver)
            {
                GameOver();
            }
        }

        TimerText.GetComponent <Text>().text = string.Format("{0:#0}", timer);

        if (!goalAlive && !gameOver)
        {
            SpawnGoal();
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     timer     = GameObject.Find("Canvas/Timer");
     timerText = timer.GetComponent <TimerText>();
     s         = Score.instance;
 }
Example #19
0
 public void textBox_Input()
 {
     number = NumberGenerator();
     TimerText.Clear();
 }
Example #20
0
        private void Complete_Button_Clicked(Object sender, EventArgs e)
        {
            if (e_Exercise.b_setupGoal && e_Exercise.b_setupLatest)
            {
                if (i_Current_Set_Number < 7)// sets next set of sit ups
                {
                    if (b_TimerStarted)
                    {
                        TimerText.TimerStop();
                        TimerText.IsVisible   = false;
                        RestText.IsVisible    = false;
                        SecondsText.IsVisible = false;
                        TimerText.Text        = "Timer Starting";
                        i_Current_Set_Number++;

                        CurrentSetText.IsVisible = true;
                        CurrentSetText.Text      = "" + ia_Current_Session[i_Current_Set_Number];
                        b_TimerStarted           = false;

                        CompleteText.IsEnabled   = true;
                        CompleteText.IsVisible   = true;
                        ExercisNowText.IsEnabled = true;
                        ExercisNowText.IsVisible = true;
                    }
                    else
                    {
                        RestText.IsVisible = true;

                        TimerText.IsVisible = true;

                        CurrentSetText.IsVisible = false;
                        SecondsText.IsVisible    = true;

                        TimerStart();
                        CompleteText.IsEnabled   = false;
                        CompleteText.IsVisible   = false;
                        ExercisNowText.IsEnabled = false;
                        ExercisNowText.IsVisible = false;
                    }
                }
                else
                {
                    if (e_Exercise.i_Current == e_Exercise.i_Goal)
                    {
                        CurrentSetText.Text = "Congratulations!, You've completed your goal";
                    }
                    else
                    {
                        CompleteText.IsEnabled   = false;
                        CompleteText.IsVisible   = false;
                        ExercisNowText.IsEnabled = false;
                        ExercisNowText.IsVisible = false;
                        CurrentSetText.Text      = "Completed, How was your workout?";
                        e_Exercise.i_Current    += 8;
                        e_Exercise.b_setupLatest = true;
                        Storage.SetExercise(s_Exercise, e_Exercise);
                        //Storage.setLatest(s_Exercise, e_Exercise.i_Current + 8);

                        EasyButton.IsEnabled    = true;
                        EasyButton.IsVisible    = true;
                        PerfectButton.IsEnabled = true;
                        PerfectButton.IsVisible = true;
                        HardButton.IsEnabled    = true;
                        HardButton.IsVisible    = true;
                    }
                    CompleteButton.IsEnabled = false;
                    CompleteButton.IsVisible = false;
                }
            }
            else if (e_Exercise.b_setupGoal)
            {
                if ((SetAmount.Text != "") && (int.TryParse(SetAmount.Text, out int i)))
                {
                    CurrentSetText.Text      = "Completed";
                    e_Exercise.i_Current     = i;
                    e_Exercise.b_setupLatest = true;
                    Storage.SetExercise(s_Exercise, e_Exercise);
                    //Storage.setLatest(s_Exercise, i);

                    // e_Exercise.b_setupLatest = true;



                    CompleteButton.IsEnabled = false;
                    CompleteButton.IsVisible = false;

                    SetAmount.IsVisible = false;
                    SetAmount.IsEnabled = false;
                }
            }
            else
            {
                if ((SetAmount.Text != "") && (int.TryParse(SetAmount.Text, out int i)))
                {
                    CurrentSetText.Text    = "Please enter the maximum amount of " + e_Exercise.s_Name + " you can complete";
                    e_Exercise.i_Goal      = i;
                    e_Exercise.b_setupGoal = true;
                    Storage.SetExercise(s_Exercise, e_Exercise);
                    //Storage.setGoal(s_Exercise, i);

                    //e_Exercise.b_setupGoal = true;

                    SetAmount.Text = "";
                }
            }
        }
Example #21
0
    // runs the host
    public void RunHost()
    {
        // setting ip address
        if (ipAddressInput != null)
        {
            string str = ipAddressInput.text;
            onlineManager.SetIPAddress(str, true);
        }

        // setting port
        if (ipAddressInput != null)
        {
            int val = int.Parse(portInput.text);
            onlineManager.SetPort(val);
        }

        // if the online manager isn't the master, disable the item spawner.
        if (!onlineManager.isMaster) // this is a client, not a server.
        {
            // finds the item spanwer
            ItemSpawner spawner = FindObjectOfType <ItemSpawner>();

            // if the item spawner exists.
            if (spawner != null)
            {
                // disable spawning operations.
                // this makes it so that new items are given by the server onyl.
                spawner.spawnerEnabled = false;
            }
        }

        // if the timer has not been set.
        if (onlineManager.timer == null)
        {
            // finds timer text
            TimerText timerText = FindObjectOfType <TimerText>();

            // timer text found.
            if (timerText != null)
            {
                TimerObject timerObject = timerText.GetActiveTimer();

                // checks to see if the timer object is set.
                if (timerObject != null)
                {
                    // sets timer for online manager.
                    onlineManager.timer = timerObject;
                }

                // if this isn't the master, disable the timer.
                if (!onlineManager.isMaster)
                {
                    // pauses the active timer
                    timerText.PauseActiveTimer();
                }
            }
        }

        // onlineManager.isMaster = ;
        bool success = onlineManager.RunHost();

        // display messages
        if (onlineManager.isMaster && success) // server running
        {
            Debug.Log("Server Running");
        }
        else if (!onlineManager.isMaster && success) // client running
        {
            Debug.Log("Client Running");
        }
        else if (!success) // nothing running.
        {
            Debug.LogError("Host Run Failed.");
        }
    }