//SoundPlayer typewriter; public Menu() { //Enable full screen FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; this.DoubleBuffered = true; InitializeComponent(); logo = new PictureBox(); pngLogo = new Bitmap(@"Drawable\logoMenu.png"); logo.BackColor = Color.Transparent; logo.Image = pngLogo; logo.Width = pngLogo.Width; logo.Height = pngLogo.Height; logo.Location = new Point(250, 20); kontrolkaNowaGraKomputer = new Kontrolka(@"Buttons\MenuButtons\NewGameNormal.png", @"Buttons\MenuButtons\NewGamePress.png", @"Buttons\MenuButtons\NewGameFocus.png", 450, 350, "NewGameComputerTag"); kontrolkaNowaGraGracz = new Kontrolka(@"Buttons\MenuButtons\NewGameNormal.png", @"Buttons\MenuButtons\NewGamePress.png", @"Buttons\MenuButtons\NewGameFocus.png", 450, 450, "NewGameTag"); kontrolkaRanking = new Kontrolka(@"Buttons\MenuButtons\RankingNormal.png", @"Buttons\MenuButtons\RankingPress.png", @"Buttons\MenuButtons\RankingFocus.png", 480, 550, "RankingTag"); kontrolkaExit = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 650, "ExitTag"); this.Controls.Add(logo); this.Controls.Add(kontrolkaNowaGraKomputer); this.Controls.Add(kontrolkaNowaGraGracz); this.Controls.Add(kontrolkaRanking); this.Controls.Add(kontrolkaExit); this.BackgroundImage = new Bitmap(@"Drawable\Wall_Beige.png"); kontrolkaNowaGraKomputer.MouseClick += new MouseEventHandler(mouseClick); kontrolkaNowaGraGracz.MouseClick += new MouseEventHandler(mouseClick); kontrolkaRanking.MouseClick += new MouseEventHandler(mouseClick); kontrolkaExit.MouseClick += new MouseEventHandler(mouseClick); }
public GraKomputerForm(Rundy runda, Profile profile, GraKomputer gra, Boolean nastepnyGracz) { poleKomp = new int[2]; FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; this.DoubleBuffered = true; InitializeComponent(); this.runda = runda; this.gra = gra; this.nastepnyGracz = nastepnyGracz; this.profile = profile; pola = new Kontrolka[3, 3]; logo = new PictureBox(); pngLogo = new Bitmap(@"Drawable\logoMsg.png"); logo.BackColor = Color.Transparent; logo.Image = pngLogo; logo.Width = pngLogo.Width; logo.Height = pngLogo.Height; logo.Location = new Point(250, 20); pola[0, 0] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 540, 150, "Pole00Tag"); pola[0, 1] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 604, 150, "Pole01Tag"); pola[0, 1] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 604, 150, "Pole01Tag"); pola[0, 1] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 604, 150, "Pole01Tag"); pola[0, 2] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 668, 150, "Pole02Tag"); pola[1, 0] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 540, 214, "Pole10Tag"); pola[1, 1] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 604, 214, "Pole11Tag"); pola[1, 2] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 668, 214, "Pole12Tag"); pola[2, 0] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 540, 278, "Pole20Tag"); pola[2, 1] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 604, 278, "Pole21Tag"); pola[2, 2] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 668, 278, "Pole22Tag"); pola[2, 2] = new Kontrolka(@"Buttons\GameButtons\LeftNormal.png", @"Buttons\GameButtons\LeftPress.png", @"Buttons\GameButtons\LeftFocus.png", 668, 278, "Pole22Tag"); kontrolkaMenu = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 500, "MenuTag"); kontrolkaExit = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 600, "ExitTag"); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) this.Controls.Add(pola[i, j]); this.Controls.Add(logo); this.Controls.Add(kontrolkaMenu); this.Controls.Add(kontrolkaExit); this.BackgroundImage = new Bitmap(@"Drawable\Wall_Beige.png"); for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) pola[i, j].MouseClick += new MouseEventHandler(mouseClick); kontrolkaMenu.MouseClick += new MouseEventHandler(mouseClick); kontrolkaExit.MouseClick += new MouseEventHandler(mouseClick); }
public NazwyGraczyForm() { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; this.DoubleBuffered = true; InitializeComponent(); logo = new PictureBox(); pngLogo = new Bitmap(@"Drawable\logoMsg.png"); logo.BackColor = Color.Transparent; logo.Image = pngLogo; logo.Width = pngLogo.Width; logo.Height = pngLogo.Height; logo.Location = new Point(250, 20); gra = new Gra(); pro = new Profile(); kontrolkaUser1 = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", 200, 200, "ExitTag"); user1Box = new TextBox(); user1Box.Location = new Point(540,200); user1Box.AutoSize = false; user1Box.Size = new Size(600, kontrolkaUser1.Height); user1Box.Font = new Font(user1Box.Font.FontFamily, 32); kontrolkaUser2 = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", 200, 300, "ExitTag"); user2Box = new TextBox(); user2Box.Location = new Point(540, 300); user2Box.AutoSize = false; user2Box.Size = new Size(600, kontrolkaUser1.Height); user2Box.Font = new Font(user2Box.Font.FontFamily, 32); kontrolkaConfirm = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 400, "ConfirmTag"); kontrolkaMenu = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 500, "MenuTag"); kontrolkaExit = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 600, "ExitTag"); this.Controls.Add(logo); this.Controls.Add(kontrolkaUser1); this.Controls.Add(kontrolkaUser2); this.Controls.Add(kontrolkaConfirm); this.Controls.Add(kontrolkaMenu); this.Controls.Add(kontrolkaExit); this.Controls.Add(user1Box); this.Controls.Add(user2Box); this.BackgroundImage = new Bitmap(@"Drawable\Wall_Beige.png"); kontrolkaConfirm.MouseClick += new MouseEventHandler(mouseClick); kontrolkaMenu.MouseClick += new MouseEventHandler(mouseClick); kontrolkaExit.MouseClick += new MouseEventHandler(mouseClick); }
private void upDate(int x, int y) { int ruch = 3 * x + y + 1; gra.ruchGracza(nastepnyGracz, ruch); poleKomp = gra.ruchKomputera(!nastepnyGracz); wynik = gra.wygrana(); runda.runda(wynik); if (gra.wygrana() != 0) { CzyNastepnaRundaKomputerForm czyNastepnaRundaKomputer = new CzyNastepnaRundaKomputerForm(runda, profile, gra, nastepnyGracz); czyNastepnaRundaKomputer.Tag = this; czyNastepnaRundaKomputer.Show(this); this.Hide(); } int initialPositionX = pola[x, y].getPozycjaX(); int initialPositionY = pola[x, y].getPozycjaY(); int positionX = pola[poleKomp[0], poleKomp[1]].getPozycjaX(); int positionY = pola[poleKomp[0], poleKomp[1]].getPozycjaY(); pola[x, y].Dispose(); pola[poleKomp[0], poleKomp[1]].Dispose(); if (nastepnyGracz == false) { pola[x, y] = new Kontrolka(@"Buttons\GameButtons\UpNormal.png", @"Buttons\GameButtons\UpPress.png", @"Buttons\GameButtons\UpFocus.png", initialPositionX, initialPositionY, "Pole002Tag"); pola[poleKomp[0], poleKomp[1]] = new Kontrolka(@"Buttons\GameButtons\DownNormal.png", @"Buttons\GameButtons\DownPress.png", @"Buttons\GameButtons\DownFocus.png", positionX, positionY, "Pole002Tag"); } else { pola[x, y] = new Kontrolka(@"Buttons\GameButtons\DownNormal.png", @"Buttons\GameButtons\DownPress.png", @"Buttons\GameButtons\DownFocus.png", initialPositionX, initialPositionY, "Pole002Tag"); pola[poleKomp[0], poleKomp[1]] = new Kontrolka(@"Buttons\GameButtons\UpNormal.png", @"Buttons\GameButtons\UpPress.png", @"Buttons\GameButtons\UpFocus.png", positionX, positionY, "Pole002Tag"); } this.Controls.Add(pola[x, y]); this.Controls.Add(pola[poleKomp[0], poleKomp[1]]); }
public CzyNastepnaRundaForm(Rundy runda, Profile profile, Gra gra, bool nastepnyGracz) { FormBorderStyle = FormBorderStyle.None; WindowState = FormWindowState.Maximized; this.DoubleBuffered = true; InitializeComponent(); // TODO: Complete member initialization this.runda = runda; this.profile = profile; this.gra = gra; this.nastepnyGracz = nastepnyGracz; logo = new PictureBox(); pngLogo = new Bitmap(@"Drawable\logoMsg.png"); logo.BackColor = Color.Transparent; logo.Image = pngLogo; logo.Width = pngLogo.Width; logo.Height = pngLogo.Height; logo.Location = new Point(250, 20); kontrolkaRunda = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", 200, 150, "RundaTag"); kontrolkaGraczKolko = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", 200, 250, "GraczKolkoTag"); kontrolkaGraczKrzyzyk = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitNormal.png", 200, 350, "GraczKrzyzykTag"); kontrolkaNastepnaRunda = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 450, "NastepnaRundaTag"); kontrolkaMenu = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 550, "MenuTag"); kontrolkaExit = new Kontrolka(@"Buttons\MenuButtons\ExitNormal.png", @"Buttons\MenuButtons\ExitPress.png", @"Buttons\MenuButtons\ExitFocus.png", 540, 650, "ExitTag"); rundaBox = new TextBox(); rundaBox.Location = new Point(540, 150); rundaBox.AutoSize = false; rundaBox.Size = new Size(600, kontrolkaRunda.Height); rundaBox.Font = new Font(rundaBox.Font.FontFamily, 32); rundaBox.AppendText(runda.getLicznikRund().ToString()); kolkoBox = new TextBox(); kolkoBox.Location = new Point(540, 250); kolkoBox.AutoSize = false; kolkoBox.Size = new Size(600, kontrolkaRunda.Height); kolkoBox.Font = new Font(kolkoBox.Font.FontFamily, 32); kolkoBox.AppendText(profile.getGracz2().ToString() + " " + runda.getLicznikKolko()); krzyzykBox = new TextBox(); krzyzykBox.Location = new Point(540, 350); krzyzykBox.AutoSize = false; krzyzykBox.Size = new Size(600, kontrolkaRunda.Height); krzyzykBox.Font = new Font(rundaBox.Font.FontFamily, 32); krzyzykBox.AppendText(profile.getGracz1().ToString() + " " + runda.getLicznikKrzyzyk()); this.Controls.Add(rundaBox); this.Controls.Add(kolkoBox); this.Controls.Add(krzyzykBox); this.Controls.Add(kontrolkaRunda); this.Controls.Add(kontrolkaGraczKolko); this.Controls.Add(kontrolkaGraczKrzyzyk); this.Controls.Add(kontrolkaNastepnaRunda); this.Controls.Add(kontrolkaMenu); this.Controls.Add(kontrolkaExit); this.Controls.Add(logo); this.BackgroundImage = new Bitmap(@"Drawable\Wall_Beige.png"); kontrolkaRunda.MouseClick += new MouseEventHandler(mouseClick); kontrolkaGraczKolko.MouseClick += new MouseEventHandler(mouseClick); kontrolkaGraczKrzyzyk.MouseClick += new MouseEventHandler(mouseClick); kontrolkaNastepnaRunda.MouseClick += new MouseEventHandler(mouseClick); kontrolkaMenu.MouseClick += new MouseEventHandler(mouseClick); kontrolkaExit.MouseClick += new MouseEventHandler(mouseClick); }