コード例 #1
0
        public Menu()
        {
            Play         = new Button(new Point(140, 50), Resources.btnPlayDark, Resources.btnPlay, 150, 70);
            Achiev       = new Button(new Point(140, 130), Resources.btnAchievDark, Resources.btnAchiev, 150, 70);
            Leaderboards = new Button(new Point(140, 210), Resources.btnLeadDark, Resources.btnLead, 150, 70);
            Quit         = new Button(new Point(140, 290), Resources.btnQuitDark, Resources.btnQuit, 150, 70);
            Easy         = new Button(new Point(55, 375), Resources.btnEasyDark, Resources.btnEasy, 90, 90);
            Medium       = new Button(new Point(175, 375), Resources.btnMediumDark, Resources.btnMedium, 90, 90);
            Hard         = new Button(new Point(295, 375), Resources.btnHardDark, Resources.btnHard, 90, 90);
            Diff         = difficulty.EASY;
            Easy.Clicked = true;
            InitializeComponent();
            this.BackgroundImage = Resources.background;
            DoubleBuffered       = true;
            skinImage            = new ImageWrapper(Resources.mine);
            skinImage.getImage().Tag = "Mine";

            // try read from file, if can -> overwrite this ^ list
            if (LoadAchievements() != null)
            {
                achievements = LoadAchievements();
            }
            else
            {
                achievements = new List <Achievement>();
                achievements.Add(new Achievement("Baloon", Resources.baloon, Resources.baloonLocked, 45, difficulty.EASY));
                achievements.Add(new Achievement("Nuke", Resources.nuke, Resources.nukeLocked, 15, difficulty.EASY));
                achievements.Add(new Achievement("Poison", Resources.poison, Resources.poisonLocked, 240, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Shuriken", Resources.shuriken, Resources.shurikenLocked, 120, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Trap", Resources.trap, Resources.trapLocked, 600, difficulty.HARD));
                achievements.Add(new Achievement("Bomb", Resources.bomb, Resources.bombLocked, 480, difficulty.HARD));
            }
        }
コード例 #2
0
        public Game(difficulty d, ImageWrapper s, List <Achievement> achievements)
        {
            this.skin = s.getImage();
            DIFF      = difficulty.NONE;

            this.DoubleBuffered = true;

            //default tile size

            InitializeComponent();
            this.achievements = achievements;
            newGame(d);
        }
コード例 #3
0
        public AchievementsForm(ImageWrapper skin, List <Achievement> achievements)
        {
            InitializeComponent();
            this.DoubleBuffered = true;
            click                = false;
            this.skin            = skin;
            this.achievements    = achievements;
            this.BackgroundImage = Properties.Resources.background;
            pictureBox7.Image    = Properties.Resources.mine;
            Back = new Button(new Point(500, 500), Properties.Resources.btnBackDark, Properties.Resources.btnBackLight, 125, 59);

            boxes    = new PictureBox[6];
            boxes[0] = pictureBox1;
            boxes[1] = pictureBox2;
            boxes[2] = pictureBox3;
            boxes[3] = pictureBox6;
            boxes[4] = pictureBox5;
            boxes[5] = pictureBox4;

            for (int i = 0; i < 6; i++)
            {
                boxes[i].Image = achievements[i].getImage(); // se zima lock ili unlock image
            }

            //mora hard-kodirano
            pictureBox1.Image.Tag = "Baloon";
            pictureBox2.Image.Tag = "Nuke";
            pictureBox3.Image.Tag = "Poison";
            pictureBox6.Image.Tag = "Bomb";
            pictureBox5.Image.Tag = "Trap";
            pictureBox4.Image.Tag = "Shuriken";

            Point a = new Point(pictureBox7.Location.X - 5, pictureBox7.Location.Y - 3);
            Size  b = new Size(125, 125);

            selected = new Rectangle(a, b);//selected e pravoagolnikot sho kazuva so koj skin igrame
            for (int i = 0; i < 6; i++)
            {
                if ((string)boxes[i].Image.Tag == (string)skin.image.Tag)  // ja naogjam bombata sho ja koristi i ja "selektiram"
                {
                    a        = new Point(boxes[i].Location.X - 5, boxes[i].Location.Y - 3);
                    b        = new Size(125, 125);
                    selected = new Rectangle(a, b);
                }
            }

            Invalidate();
        }
コード例 #4
0
ファイル: Game.cs プロジェクト: vavramovski/Minesweeper
        public Game(difficulty d, ImageWrapper s, List <Achievement> achievements)
        {
            this.skin = s;
            DIFF      = difficulty.NONE;

            this.DoubleBuffered = true;
            this.BackColor      = Color.LightGray;

            //default tile size
            resizeHold = true;

            resizeHold = false;

            InitializeComponent();
            HeightOffset      = miniMenu.Height + button1.Height + 15;
            this.achievements = achievements;
            newGame(d);
        }
コード例 #5
0
ファイル: Grid.cs プロジェクト: vavramovski/Minesweeper
        public Grid(int numberOfBombs, ImageWrapper skin)
        {
            this.skin      = skin;
            imagesByNumber = new Dictionary <int, ImageWrapper>();
            //add images
            mainImages = new List <ImageWrapper>();
            addImages();

            //initialize matrix
            bombCount  = numberOfBombs;
            mainMatrix = new Tile[Game.tileRowNumber][];
            for (int i = 0; i < mainMatrix.Length; i++)
            {
                mainMatrix[i] = new Tile[Game.tileColumnNumber];
            }

            setTileNumber();
            fillMatrix();
        }
コード例 #6
0
        public Menu()
        {
            Play         = new Button(new Point(218, 100), Resources.btnPlayDark, Resources.btnPlay, 178, 84);
            Achiev       = new Button(new Point(218, 205), Resources.btnAchievDark, Resources.btnAchiev, 178, 84);
            Leaderboards = new Button(new Point(218, 310), Resources.btnLeadDark, Resources.btnLead, 178, 84);
            Quit         = new Button(new Point(218, 415), Resources.btnQuitDark, Resources.btnQuit, 178, 84);
            Easy         = new Button(new Point(135, 535), Resources.btnEasyDark, Resources.btnEasy, 100, 100);
            Medium       = new Button(new Point(257, 535), Resources.btnMediumDark, Resources.btnMedium, 100, 100);
            Hard         = new Button(new Point(380, 535), Resources.btnHardDark, Resources.btnHard, 100, 100);
            Diff         = difficulty.EASY;
            Easy.Clicked = true;
            InitializeComponent();
            this.BackgroundImage = Resources.background;
            this.ClientSize      = new Size(this.Width, Game.windowSizeConf.Height - 80);
            DoubleBuffered       = true;
            Image mine = Resources.mine;

            mine.Tag = "Mine";
            skin     = new ImageWrapper(9, mine);

            // try read from file, if can -> overwrite this ^ list
            if (LoadAchievements() != null)
            {
                achievements = LoadAchievements();
            }
            else
            {
                achievements = new List <Achievement>();
                achievements.Add(new Achievement("Baloon", Resources.baloon, Resources.baloonLocked, 45, difficulty.EASY));
                achievements.Add(new Achievement("Nuke", Resources.nuke, Resources.nukeLocked, 15, difficulty.EASY));
                achievements.Add(new Achievement("Poison", Resources.poison, Resources.poisonLocked, 240, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Shuriken", Resources.shuriken, Resources.shurikenLocked, 120, difficulty.INTERMEDIATE));
                achievements.Add(new Achievement("Trap", Resources.trap, Resources.trapLocked, 600, difficulty.HARD));
                achievements.Add(new Achievement("Bomb", Resources.bomb, Resources.bombLocked, 480, difficulty.HARD));
            }
        }