Пример #1
0
        public MainWindow()
            : base()
        {
            components = new Container();
            this.sizeField = 40;
            this.actualSpeed = pacman.Speed.medium;
            this.revenge = false;
            this.bonusIs = true;
            this.IsDraw = false;
            try{
                this.gamewin = new Bitmap( System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "pacman.Resources.game.win.png" ));
                this.gameover = new Bitmap( System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "pacman.Resources.game.over.png"));
            } catch {
                MessageBox.Show("No final picture", "error");
            }
            Text = "Pacman";
            #region /* Ikonka */
            try
            {
                Icon = new Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "pacman.Resources.pac.ico"));
            }
            catch (Exception e)
            {
                MessageBox.Show("The file could not be read:"+e.Message.ToString(), "Error with map",
                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            #endregion

            MyMymenu = new AppMenu(NewGame, Pause, SpeedCH, ChoseMap, ResizeField);
            MyMymenu.Parent = this;
            Controls.Add(MyMymenu);

            this.DoubleBuffered = true;

            Paint += new PaintEventHandler( this.OnStart );

            ClientSize = new Size(800, 600);
        }
Пример #2
0
        public MainWindow() : base()
        {
            components       = new Container();
            this.sizeField   = 40;
            this.actualSpeed = pacman.Speed.medium;
            this.revenge     = false;
            this.bonusIs     = true;
            this.IsDraw      = false;
            try{
                this.gamewin  = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("pacman.Resources.game.win.png"));
                this.gameover = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("pacman.Resources.game.over.png"));
            } catch {
                MessageBox.Show("No final picture", "error");
            }
            Text = "Pacman";
            #region             /* Ikonka */
            try
            {
                Icon = new Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("pacman.Resources.pac.ico"));
            }
            catch (Exception e)
            {
                MessageBox.Show("The file could not be read:" + e.Message.ToString(), "Error with map",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            #endregion

            MyMymenu        = new AppMenu(NewGame, Pause, SpeedCH, ChoseMap, ResizeField);
            MyMymenu.Parent = this;
            Controls.Add(MyMymenu);

            this.DoubleBuffered = true;

            Paint += new PaintEventHandler(this.OnStart);

            ClientSize = new Size(800, 600);
        }