Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();
            mainSound = new Sounds();
            this.CenterToScreen();
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Width = Resources.squares.Width + 15;
            this.Height = Resources.squares.Width + 15;
            this.BackColor = System.Drawing.Color.Black;
            this.DoubleBuffered = true;

            main = Resources.squares;
            playBtn = Resources.Play2;
            highScoresBtn = Resources.Score1;
            helpBtn = Resources.HelpBtn;
            exitBtn = Resources.Exit;
            playBtnHover = Resources.Play_hover;
            exitBtnHover = Resources.Exit_hover;
            scoresBtnHover = Resources.Score_hover;
            helpBtnHover = Resources.Help_hover;

            scoresHoverBtmp = new Bitmap(scoresBtnHover, new Size(210, 80));
            helpHoverBtmp = new Bitmap(helpBtnHover, new Size(210, 80));
            exitHoverBtmp = new Bitmap(exitBtnHover, new Size(210, 80));
            playHoverBtmp = new Bitmap(playBtnHover, new Size(210, 80));
            exitBitmap = new Bitmap(exitBtn, new Size(210, 80));
            helpBitmap = new Bitmap(helpBtn, new Size(210, 80));
            highScoreBitmap = new Bitmap(highScoresBtn, new Size(210, 80));
            playBitmap = new Bitmap(playBtn, new Size(210, 80));
            mainBitmap = new Bitmap(main);

            s1 = new Square(220, 410, 40);
            s1.image = Resources._1;
            s2 = new Square(290, 35, 40);
            s2.image = Resources._9;
            s3 = new Square(350, 220, 40);
            s3.image = Resources._5;
            s4 = new Square(410, 200, 40);
            s4.image = Resources._7;

            hs = new HighScores();

            animationTimer.Start();
        }
Esempio n. 2
0
        public SquaresMatrix(int r, int c, int w, int o)
        {
            rows = r;
            columns = c;
            offset = o;
            squareWidth = w;
            score = 0;
            combo = 0;
            numberOfSquares = 5;
            numberOfSquaresPainted = 0;
            gameOver = false;
            random = new Random();
            randomImage = new RandomImage();
            gameSound = new Sounds();
            selectedSquare = null;
            selectedSquareDest = null;

            initializeMatrix();
            paintRandomSquares(numberOfSquares);
        }