Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        Venceu     = true;
        scoreTimer = FindObjectOfType <ScoreTimer>();
        Score      = gameObject.GetComponent <TextMeshProUGUI>();
        Score.text = "Pontuação: " + scoreTimer.Score;

        AnalyticsResult analyticsResult = Analytics.CustomEvent(
            "Vitória",
            new Dictionary <string, object> {
            { "Level ganho: ", SceneManager.GetActiveScene().buildIndex }
        }

            );

        Debug.Log("Resultado dos analytics" + analyticsResult);


        AnalyticsResult analyticsScore = Analytics.CustomEvent(
            "Pontos do player",
            new Dictionary <string, object>
        {
            { "Pontos: ", scoreTimer.Score }
        }
            );

        Debug.Log("Resultado dos analytics" + analyticsScore);
    }
Exemple #2
0
    public void takeDamage()
    {
        GameObject lifeObject;

        life += 1;

        switch (life)
        {
        case 1:
            lifeObject = GameObject.Find("fullheart1");
            DestroyObject(lifeObject);
            break;

        case 2:
            lifeObject = GameObject.Find("half-heart1");
            DestroyObject(lifeObject);
            break;

        case 3:
            lifeObject = GameObject.Find("fullheart2");
            DestroyObject(lifeObject);
            break;

        case 4:
            lifeObject = GameObject.Find("half-heart2");
            DestroyObject(lifeObject);
            break;

        case 5:
            lifeObject = GameObject.Find("fullheart3");
            DestroyObject(lifeObject);
            break;

        case 6:
            lifeObject = GameObject.Find("half-heart3");
            DestroyObject(lifeObject);
            break;

        case 7:
            lifeObject = GameObject.Find("fullheart4");
            DestroyObject(lifeObject);
            break;

        case 8:
            lifeObject = GameObject.Find("half-heart4");
            DestroyObject(lifeObject);
            break;
        }

        if (life >= 8)
        {
            GameObject go = GameObject.Find("Camera");
            ScoreTimer timerController = go.GetComponent <ScoreTimer>();
            timerController.gameFinished = true;

            gameObject.GetComponent <PlayerMovement>().enabled = false;
            anim.SetBool("isDead", true);
            StartCoroutine(Wait());
        }
    }
Exemple #3
0
        protected bool ScoreFastMatchTokens()
        {
            ScoreTimer.Start();
            var data = Scorer.CalculateScoresAndStoreData(FastmatchActiveList.GetTokens());

            ScoreTimer.Stop();

            Token bestToken = null;

            if (data is Token)
            {
                bestToken = (Token)data;
            }
            else
            {
                _fastmatchStreamEnd = true;
            }

            var moreTokens = (bestToken != null);

            FastmatchActiveList.SetBestToken(bestToken);

            // monitorWords(activeList);
            MonitorStates(FastmatchActiveList);

            // System.out.println("BEST " + bestToken);

            CurTokensScored.Value   += FastmatchActiveList.Size;
            TotalTokensScored.Value += FastmatchActiveList.Size;

            return(moreTokens);
        }
Exemple #4
0
        private void ScoreTimer_Tick(object sender, EventArgs e)
        {
            scoreLabel.Text      = myscore.ToString();
            TaikoCountLabel.Text = taikocount.ToString();

            if (taikocount == 100)
            {
                Taikotimer.Stop();
                HitSecondsTimer.Stop();
                ScoreTimer.Stop();

                /*System.Media.SoundPlayer player = new System.Media.SoundPlayer();
                 * //player.SoundLocation = @"C:\Users\acer\Desktop\Things\Music\wav\My Dearest.wav";
                 * player.Stop();
                 * player.Dispose();*/


                Taiko1.Visible   = false;
                Taiko2.Visible   = false;
                Taiko3.Visible   = false;
                Taiko4.Visible   = false;
                HitTaiko.Visible = false;
                owari.Visible    = true;
                endtime          = 0;
                PlayTimer.Stop();
            }
        }
        public override void StartGame(Mobile from)
        {
            base.StartGame(from);

            if (m_ScoreTimer == null)
                m_ScoreTimer = new ScoreTimer(this);
            m_ScoreTimer.Start();
        }
Exemple #6
0
 private void ScoreTimer_Tick(object sender, EventArgs e)
 {
     ScoreTimer.Stop();
     foreach (PictureBox picture in GamePanel.Controls)
     {   //Switching all cards back to cover mode
         picture.Enabled = true;
         picture.Cursor  = Cursors.Hand;
         picture.Image   = Properties.Resources.cover;
     }
 }
Exemple #7
0
        public override void StartGame(Mobile from)
        {
            base.StartGame(from);

            if (m_ScoreTimer == null)
            {
                m_ScoreTimer = new ScoreTimer(this);
            }
            m_ScoreTimer.Start();
        }
Exemple #8
0
        private void resetScoreTimerBar()
        {
            ScoreTimer.ResetScoreTick();
            var scoreTick = new ScoreTimerTickEventArgs()
            {
                ScoreTick = ScoreTimer.ScoreTick
            };

            this.ScoreTimerTick?.Invoke(this, scoreTick);
        }
Exemple #9
0
 private void onDeathAnimationDone(object sender, AnimationIsFinishedEventArgs e)
 {
     if (e.PlayerDeathIsOver && !this.IsGameOver)
     {
         this.player.ResetVisibilityAndMovement();
         ScoreTimer.ResetScoreTick();
         this.scoreTimer.Start();
         this.resetBoardForNoQuickRevive();
         checkToRemoveQuickReviveAbility();
     }
 }
Exemple #10
0
 void Start()
 {
     Time.timeScale = 1;
     pauseMenu.gameObject.SetActive(false);
     settingsMenu.gameObject.SetActive(false);
     laserPointer.gameObject.SetActive(false);
     leftHand.gameObject.SetActive(true);
     rightHand.gameObject.SetActive(true);
     st   = ScoreManager.GetComponent <ScoreTimer>();
     plyr = player.GetComponent <PlayerVR>();
 }
Exemple #11
0
 void Start()
 {
     foreach (GameObject l in Lights)
     {
         MPBs.Add(l.GetComponent <MemoryPodiumBehaviour>());
         roomPodCorrs.Add(false);
     }
     plyr        = Player.GetComponent <PlayerVR>();
     st          = ScoreManager.GetComponent <ScoreTimer>();
     sbm         = ScoreBoard.GetComponent <ScoreBoardMove>();
     light       = GetComponent <Light>();
     light.color = colorBlack;
 }
Exemple #12
0
        private void PlayBtn_Click(object sender, EventArgs e)
        {
            System.Media.SoundPlayer player = new System.Media.SoundPlayer();
            player.Stream = Properties.Resources.Believer3;
            //player.SoundLocation = @"C:\Users\acer\Desktop\Things\Music\wav\My Dearest.wav";

            player.Play();
            Taiko1.Visible = true;
            Taikotimer.Start();
            ScoreTimer.Start();
            PlayTimer.Start();
            taikocount    = 0;
            myscore       = 0;
            owari.Visible = false;
        }
Exemple #13
0
        public void ResetGame()
        {
            PlayerMessage("The game has started.");

            m_StartTime = DateTime.Now;

            m_GameTimer = Timer.DelayCall(Length, new TimerCallback(EndGame));
            m_Running   = true;

            if (m_ScoreTimer == null)
            {
                m_ScoreTimer = new ScoreTimer(this);
            }
            m_ScoreTimer.Start();

            for (int i = 0; i < m_Teams.Count; i++)
            {
                CTFTeam team = (CTFTeam)m_Teams[i];

                team.Points = 0;
                if (team.Flag != null)
                {
                    team.Flag.ReturnToHome();
                }

                for (int j = 0; j < team.Members.Count; j++)
                {
                    Mobile m = (Mobile)team.Members[j];

                    m.Kill();
                    if (m.Corpse != null && !m.Corpse.Deleted)
                    {
                        m.Corpse.Delete();
                    }

                    m.LogoutLocation = team.Home;
                    m.Location       = team.Home;
                    m.Location       = team.Home;
                    m.Map            = team.Map;

                    m.Resurrect();

                    m.Hits = m.HitsMax;
                    m.Mana = m.ManaMax;
                    m.Stam = m.StamMax;
                }
            }
        }
Exemple #14
0
    public void takeDamage()
    {
        life -= 20;
        if (life <= 0)
        {
            collider.GetComponent <EnemyAttack>().enabled    = false;
            gameObject.GetComponent <EnemyRoutine>().enabled = false;
            anim.SetBool("isDead", true);

            // Make points in Score
            GameObject go = GameObject.Find("Camera");
            ScoreTimer scoreController = go.GetComponent <ScoreTimer>();
            scoreController.score += 2;

            StartCoroutine(Wait());
        }
    }
Exemple #15
0
        public virtual void ClearGame()
        {
            if (m_GameTimer != null)
            {
                m_GameTimer.Stop();
                m_GameTimer = null;
            }

            if (m_ScoreTimer != null)
            {
                m_ScoreTimer.Stop();
                m_ScoreTimer = null;
            }

            if (m_GumpTimer != null)
            {
                m_GumpTimer.Stop();
                m_GumpTimer = null;
            }

            m_Winners.Clear();
            m_PlayerScores.Clear();

            List <Mobile> toRemove = new List <Mobile>();

            foreach (Mobile player in Players)
            {
                toRemove.Add(player);
            }

            foreach (Mobile player in toRemove)
            {
                RemovePlayer(player);
            }
            m_RunningGames.Remove(this);
            m_Running    = false;
            Open         = false;
            BeginGame    = false;
            m_GameMaster = null;
        }
Exemple #16
0
        private void MemoryGame_Load(object sender, EventArgs e)
        {
            label1.Text = "3"; //Label Displaying the time before cards are flipped to Cover mode
            foreach (PictureBox picture in GamePanel.Controls)
            {
                picture.Enabled = false;
                points.Add(picture.Location);
            }
            foreach (PictureBox picture in GamePanel.Controls)
            {  //Randomisation of Images
                int   next = location.Next(points.Count);
                Point p    = points[next];
                picture.Location = p;
                points.Remove(p);
            }

            ScoreTimer.Start();
            CountdownTimer.Start();
            img1.Image     = Properties.Resources.img1;
            dupimg1.Image  = Properties.Resources.img1;
            img2.Image     = Properties.Resources.img2;
            dupimg2.Image  = Properties.Resources.img2;
            img3.Image     = Properties.Resources.img3;
            dupimg3.Image  = Properties.Resources.img3;
            img4.Image     = Properties.Resources.img4;
            dupimg4.Image  = Properties.Resources.img4;
            img5.Image     = Properties.Resources.img5;
            dupimg5.Image  = Properties.Resources.img5;
            img6.Image     = Properties.Resources.img6;
            dupimg6.Image  = Properties.Resources.img6;
            img7.Image     = Properties.Resources.img7;
            dupimg7.Image  = Properties.Resources.img7;
            img8.Image     = Properties.Resources.img8;
            dupimg8.Image  = Properties.Resources.img8;
            img9.Image     = Properties.Resources.img9;
            dupimg9.Image  = Properties.Resources.img9;
            img10.Image    = Properties.Resources.img10;
            dupimg10.Image = Properties.Resources.img10;
        }
Exemple #17
0
 private void Awake()
 {
     ScoreTimer.LoadHighscore();
 }
Exemple #18
0
 private void Start()
 {
     if (ScoreTimer.highscore < 0)
     {
         // No score at all
         gameObject.SetActive(false);
     }
     else if (ScoreTimer.newHighscore == false)
     {
         if (ScoreTimer.oldScore > 0)
         {
             // View old highscore and old score
             if (viewing == Viewing.OldScore)
             {
                 text.text = ScoreTimer.FormatTime(ScoreTimer.oldScore);
             }
             else if (viewing == Viewing.OldHighscore)
             {
                 text.text = ScoreTimer.FormatTime(ScoreTimer.highscore);
             }
             else
             {
                 gameObject.SetActive(false);
             }
         }
         else
         {
             // View old highscore
             if (viewing == Viewing.OldScore)
             {
                 gameObject.SetActive(false);
             }
             else if (viewing == Viewing.OldHighscore)
             {
                 text.text = ScoreTimer.FormatTime(ScoreTimer.highscore);
                 var rect = transform as RectTransform;
                 rect.pivot            = new Vector2(0.5f, rect.pivot.y);
                 rect.anchoredPosition = new Vector2(0, rect.anchoredPosition.y);
             }
             else
             {
                 gameObject.SetActive(false);
             }
         }
     }
     else
     {
         // New highscore
         if (viewing == Viewing.OldScore)
         {
             gameObject.SetActive(false);
         }
         else if (viewing == Viewing.OldHighscore)
         {
             gameObject.SetActive(false);
         }
         else
         {
             text.text = ScoreTimer.FormatTime(ScoreTimer.highscore);
         }
     }
 }
Exemple #19
0
		public void ResetGame()
		{

			PlayerMessage( "The game has started." );
			
			m_StartTime = DateTime.Now;

			m_GameTimer = Timer.DelayCall( Length, new TimerCallback( EndGame ) );
			m_Running = true;

			if ( m_ScoreTimer == null )
				m_ScoreTimer = new ScoreTimer( this );
			m_ScoreTimer.Start();

			for (int i=0;i<m_Teams.Count;i++)
			{
				CTFTeam team = (CTFTeam)m_Teams[i];

				team.Points = 0;
				if ( team.Flag != null )
					team.Flag.ReturnToHome();

				for(int j=0;j<team.Members.Count;j++)
				{
					Mobile m = (Mobile)team.Members[j];

					m.LogoutLocation = team.Home;
					m.Location = team.Home;
					m.SolidHueOverride = team.Hue;
					m.Map = team.Map;
                                        m.Blessed = false;
	

					m.Hits = m.HitsMax;
					m.Mana = m.ManaMax;
					m.Stam = m.StamMax;

					//m.SendGump(new scoregump(m_Game2,m));

					//m.SendMessage("Game is reset you {0}",j);
				}
			}
		}
Exemple #20
0
        public virtual void StartGame(Mobile from)
        {
            if (Open && BeginGame)
            {
                try
                {
                    m_RunningGames.Add(this);
                    m_GameMaster = from;
                    m_StartTime = DateTime.Now;
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
            if (!Open)
            {
                throw new EventException("You cannot start a game that is not open!");
            }
            if (Running)
            {
                throw new EventException("The game is already running!");
            }
            try
            {
            m_RunningGames.Add(this);
            m_GameMaster = from;
            m_StartTime = DateTime.Now;
            }
            catch (Exception e)
            {
            	Console.WriteLine(e.ToString());
        	}

            if (m_GameTimer != null)
            {
                m_GameTimer.Stop();
                m_GameTimer = null;
            }

            if (m_ScoreTimer != null)
            {
                m_ScoreTimer.Stop();
                m_ScoreTimer = null;
            }

            if (m_GumpTimer != null)
            {
                m_GumpTimer.Stop();
                m_GumpTimer = null;
            }

            if (Length.TotalSeconds > 0)
            {
                m_GameTimer = new GameTimer(this);
                m_GameTimer.Start();
            }

            if (m_UseGump)
            {
                //m_GumpTimer = new GameGumpTimer(this);
                //m_GumpTimer.Start();
            }
        }
Exemple #21
0
        public virtual void ClearGame()
        {
            if (m_GameTimer != null)
            {
                m_GameTimer.Stop();
                m_GameTimer = null;
            }

            if (m_ScoreTimer != null)
            {
                m_ScoreTimer.Stop();
                m_ScoreTimer = null;
            }

            if (m_GumpTimer != null)
            {
                m_GumpTimer.Stop();
                m_GumpTimer = null;
            }

            m_Winners.Clear();
            m_PlayerScores.Clear();

            List<Mobile> toRemove = new List<Mobile>();
            foreach (Mobile player in Players)
            {
                toRemove.Add(player);
            }

            foreach (Mobile player in toRemove)
            {
                RemovePlayer(player);
            }
            m_RunningGames.Remove(this);
            m_Running = false;
            Open = false;
            BeginGame = false;
            m_GameMaster = null;
        }
Exemple #22
0
 // Update is called once per frame
 void Start()
 {
     Player     = GameObject.FindGameObjectWithTag("Player");
     callScore  = FindObjectOfType <CallScore>();
     scoreTimer = FindObjectOfType <ScoreTimer>();
 }
Exemple #23
0
        public void ResetGame()
        {
            PlayerMessage( "The game has started." );

            m_StartTime = DateTime.Now;

            m_GameTimer = Timer.DelayCall( Length, new TimerCallback( EndGame ) );
            m_Running = true;

            if ( m_ScoreTimer == null )
                m_ScoreTimer = new ScoreTimer( this );
            m_ScoreTimer.Start();

            for (int i=0;i<m_Teams.Count;i++)
            {
                CTFTeam team = (CTFTeam)m_Teams[i];

                team.Points = 0;
                if ( team.Flag != null )
                    team.Flag.ReturnToHome();

                for(int j=0;j<team.Members.Count;j++)
                {
                    Mobile m = (Mobile)team.Members[j];

                    m.Kill();
                    if ( m.Corpse != null && !m.Corpse.Deleted )
                        m.Corpse.Delete();

                    m.LogoutLocation = team.Home;
                    m.Location = team.Home;
                    m.Location = team.Home;
                    m.Map = team.Map;

                    m.Resurrect();

                    m.Hits = m.HitsMax;
                    m.Mana = m.ManaMax;
                    m.Stam = m.StamMax;
                }
            }
        }
Exemple #24
0
 // Use this for initialization
 void Start()
 {
     sc     = GetComponent <ScoreTimer>();
     text   = GameObject.Find("Scoretext").GetComponent <Text>();
     record = 0;
 }
Exemple #25
0
        public virtual void StartGame(Mobile from)
        {
            if (Open && BeginGame)
            {
                try
                {
                    m_RunningGames.Add(this);
                    m_GameMaster = from;
                    m_StartTime  = DateTime.Now;
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.ToString());
                }
            }
            if (!Open)
            {
                throw new EventException("You cannot start a game that is not open!");
            }
            if (Running)
            {
                throw new EventException("The game is already running!");
            }
            try
            {
                m_RunningGames.Add(this);
                m_GameMaster = from;
                m_StartTime  = DateTime.Now;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            if (m_GameTimer != null)
            {
                m_GameTimer.Stop();
                m_GameTimer = null;
            }

            if (m_ScoreTimer != null)
            {
                m_ScoreTimer.Stop();
                m_ScoreTimer = null;
            }

            if (m_GumpTimer != null)
            {
                m_GumpTimer.Stop();
                m_GumpTimer = null;
            }

            if (Length.TotalSeconds > 0)
            {
                m_GameTimer = new GameTimer(this);
                m_GameTimer.Start();
            }

            if (m_UseGump)
            {
                //m_GumpTimer = new GameGumpTimer(this);
                //m_GumpTimer.Start();
            }
        }