Esempio n. 1
0
        public void loadGameScreen()
        {
            this.MaximizeBox    = false;
            this.DoubleBuffered = true;
            this.Paint         += gameForm_Paint;
            this.KeyDown       += gameForm_KeyDown;
            this.KeyUp         += gameForm_KeyUp;

            this.Size = sizes[resIdx];
            StatusBar      sbGame = new StatusBar();
            StatusBarPanel lblTime, lblScore;//, lblTest;

            lblTime  = new StatusBarPanel();
            lblScore = new StatusBarPanel();
            //lblTest = new StatusBarPanel();

            lblTime.Name = "lblTime";
            lblTime.Text = "00:00";

            lblScore.Name = "lblScore";
            lblScore.Text = "0";

            //lblTest.Name = "lblTest";
            //lblTest.Text = "TEST";

            sbGame.Name = "sbGame";
            sbGame.Panels.Add(lblTime);
            sbGame.Panels.Add(lblScore);
            //sbGame.Panels.Add(lblTest);

            sbGame.ShowPanels = true;
            this.Controls.Add(sbGame);

            playArea1 = new Rectangle(new Point(sizes[resIdx].Width / 100 - 1, sizes[resIdx].Height / 100 - 2), new Size(sizes[resIdx].Width * 48 / 100, sizes[resIdx].Height * 48 / 100));
            playArea2 = new Rectangle(new Point((sizes[resIdx].Width * 49 / 100 + 1), sizes[resIdx].Height / 100 - 2), new Size(sizes[resIdx].Width * 48 / 100, sizes[resIdx].Height * 48 / 100));
            playArea3 = new Rectangle(new Point(sizes[resIdx].Width / 100 - 1, (sizes[resIdx].Height * 48 / 100) + sizes[resIdx].Height * 1 / 100), new Size(sizes[resIdx].Width * 48 / 50 + 2, sizes[resIdx].Height * 48 / 100 - sbGame.Height - 24));

            this.game1 = new Game1();
            this.game2 = new Game2();
            this.game3 = new Game3();

            timerGame = new Timer();

            timerGame.Interval = 15;
            timerGame.Tick    += timerGame_tick;

            timerGame.Start();
            this.CenterToScreen();
            Invalidate(true);
        }
Esempio n. 2
0
 public void resetParams()
 {
     resIdx             = 0;
     currentScore       = 0;
     difficulty         = 0;
     spawnPeriod_game1  = 0;
     spawnPeriod_game2  = 0;
     modus_game3        = 5;
     prev_sec           = -1;
     game1              = null;
     game2              = null;
     game3              = null;
     currentLeaderboard = 1;
     timeTicks          = 0;
     isGameOver         = false;
     timerGame          = null;
     w     = false;
     a     = false;
     s     = false;
     d     = false;
     ud    = false;
     space = false;
 }