private GamePanel() { Size = new Size(FormJogoMemoria.Instance().Width, FormJogoMemoria.Instance().Height); Anchor = AnchorStyles.None; Name = "gamePanel"; Location = new Point(0, 0); BackColor = MyColors.GRAY; Font = fntPixel; TabIndex = 0; game = Game.Instance(); Song(); Controllers(); _ = CardsAsync(); Character(); Score(); Attacks(); Hits(); }
public void Controllers() { int x = Width - 50; for (int i = 0; i < btnControls.Length; i++) { btnControls[i] = new MyButton( $"btnControls{i}", MyStrings.controls[i], MyColors.GRAY, Color.GhostWhite, new Point(x, 0), new Size(50, 50), Color.Transparent, 0, 5 ); x -= 50; int r = i; btnControls[i].Click += (o, e) => { switch (r) { case 0: Controller.Exit(); break; case 1: Controller.DoFullscreen(FormJogoMemoria.Instance()); break; case 2: Controller.Minimize(FormJogoMemoria.Instance()); break; } }; Controls.Add(btnControls[i]); } }