Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            startGame();

            startTime = DateTime.Now;
            timerSaat.Start();

            try
            {
                GoogleAnalyticsApi.TrackPageview();
            }
            catch (Exception)
            {
            }
        }
Example #2
0
        public void startGame()
        {
            lbllevel.Text = level.ToString();
            TaniButonlari();

            ButonlarAuto();
            // karistir();
            OyunuLeveleGoreBaslat();

            try
            {
                GoogleAnalyticsApi.scrtxt = "level" + level;
                GoogleAnalyticsApi.TrackPageview();
            }
            catch (Exception)
            {
            }
        }
Example #3
0
        private void buttons_Click(object sender, EventArgs e)
        {
            Button but = (Button)sender;


            try
            {
                GoogleAnalyticsApi.TrackEvent();
            }
            catch (Exception)
            {
            }

            but.Text = (Convert.ToInt32(but.Text) + 1).ToString();
            if (Convert.ToInt32(but.Text) > 3)
            {
                but.Text = "0";
            }

            for (int i = 0; i < 16; i++)
            {
                // sol butonu arttırır
                if (Buttons[i].Location.X + 100 == but.Location.X && Buttons[i].Location.Y == but.Location.Y && Buttons[i].Text != "0")
                {
                    Buttons[i].Text = (Convert.ToInt32(Buttons[i].Text) + 1).ToString();
                    if (Convert.ToInt32(Buttons[i].Text) > 3)
                    {
                        Buttons[i].Text = "0";
                    }
                }

                // sağ butonu arttırır
                if (Buttons[i].Location.X - 100 == but.Location.X && Buttons[i].Location.Y == but.Location.Y && Buttons[i].Text != "0")
                {
                    Buttons[i].Text = (Convert.ToInt32(Buttons[i].Text) + 1).ToString();
                    if (Convert.ToInt32(Buttons[i].Text) > 3)
                    {
                        Buttons[i].Text = "0";
                    }
                }

                // üst butonu arttırır
                if (Buttons[i].Location.X == but.Location.X && Buttons[i].Location.Y == but.Location.Y - 100 && Buttons[i].Text != "0")
                {
                    Buttons[i].Text = (Convert.ToInt32(Buttons[i].Text) + 1).ToString();
                    if (Convert.ToInt32(Buttons[i].Text) > 3)
                    {
                        Buttons[i].Text = "0";
                    }
                }

                // alt butonu arttırır
                if (Buttons[i].Location.X == but.Location.X && Buttons[i].Location.Y == but.Location.Y + 100 && Buttons[i].Text != "0")
                {
                    Buttons[i].Text = (Convert.ToInt32(Buttons[i].Text) + 1).ToString();
                    if (Convert.ToInt32(Buttons[i].Text) > 3)
                    {
                        Buttons[i].Text = "0";
                    }
                }


                if (Buttons[i].Text == "1")
                {
                    Buttons[i].BackColor = Color.LightGreen;
                }
                if (Buttons[i].Text == "2")
                {
                    Buttons[i].BackColor = Color.LightBlue;
                }
                if (Buttons[i].Text == "3")
                {
                    Buttons[i].BackColor = Color.LightCoral;
                }
                if (Buttons[i].Text == "0")
                {
                    Buttons[i].BackColor = Color.LightGray;
                }


                if (Buttons[i].Text == "0")
                {
                    Buttons[i].ForeColor = Color.LightGray;
                }
                else
                {
                    Buttons[i].ForeColor = Color.Black;
                }
            }


            HamleSayisi++;
            lblHamleSayici.Text = HamleSayisi.ToString();
            isFinish();
            //  isfinish();
        }