Пример #1
0
        public Main()
        {
            InitializeComponent();
              paper = pctPlayField.CreateGraphics();
              muren = new Muren();
              rndAngle = new Random();
              splash = new Splash();
              #region initialize pacman & ghosts
              //pacman
              pacman = new Pacman();
              pacman.X = 10;
              pacman.Y = 12;
              pacman.Angle = 0;
              pacman.Wall = 0;
              pacman.PrevX = 10;
              pacman.PrevY = 12;
              pacman.Sprites = pacman.pacmanUp;

              //red ghost
              redGhost = new Monster();
              redGhost.X = 10;
              redGhost.Y = 10;
              redGhost.Angle = 3;
              redGhost.Wall = 0;
              redGhost.PrevX = 10;
              redGhost.PrevY = 10;
              redGhost.PrevAngle = 0;
              redGhost.Sprites = Image.FromFile("../../images/ghostRed.png");

              //green ghost
              greenGhost = new Monster();
              greenGhost.X = 11;
              greenGhost.Y = 10;
              greenGhost.Angle = 3;
              greenGhost.Wall = 0;
              greenGhost.PrevX = 11;
              greenGhost.PrevY = 10;
              greenGhost.PrevAngle = 0;
              greenGhost.Sprites = Image.FromFile("../../images/ghostGreen.png");

              //yellow ghost
              yellowGhost = new Monster();
              yellowGhost.X = 9;
              yellowGhost.Y = 10;
              yellowGhost.Angle = 3;
              yellowGhost.Wall = 0;
              yellowGhost.PrevX = 9;
              yellowGhost.PrevY = 10;
              yellowGhost.PrevAngle = 0;
              yellowGhost.Sprites = Image.FromFile("../../images/ghostYellow.png");
              #endregion
        }
Пример #2
0
        public Main()
        {
            InitializeComponent();
            paper    = pctPlayField.CreateGraphics();
            muren    = new Muren();
            rndAngle = new Random();
            splash   = new Splash();
            #region initialize pacman & ghosts
            //pacman
            pacman         = new Pacman();
            pacman.X       = 10;
            pacman.Y       = 12;
            pacman.Angle   = 0;
            pacman.Wall    = 0;
            pacman.PrevX   = 10;
            pacman.PrevY   = 12;
            pacman.Sprites = pacman.pacmanUp;

            //red ghost
            redGhost           = new Monster();
            redGhost.X         = 10;
            redGhost.Y         = 10;
            redGhost.Angle     = 3;
            redGhost.Wall      = 0;
            redGhost.PrevX     = 10;
            redGhost.PrevY     = 10;
            redGhost.PrevAngle = 0;
            redGhost.Sprites   = Image.FromFile("../../images/ghostRed.png");

            //green ghost
            greenGhost           = new Monster();
            greenGhost.X         = 11;
            greenGhost.Y         = 10;
            greenGhost.Angle     = 3;
            greenGhost.Wall      = 0;
            greenGhost.PrevX     = 11;
            greenGhost.PrevY     = 10;
            greenGhost.PrevAngle = 0;
            greenGhost.Sprites   = Image.FromFile("../../images/ghostGreen.png");

            //yellow ghost
            yellowGhost           = new Monster();
            yellowGhost.X         = 9;
            yellowGhost.Y         = 10;
            yellowGhost.Angle     = 3;
            yellowGhost.Wall      = 0;
            yellowGhost.PrevX     = 9;
            yellowGhost.PrevY     = 10;
            yellowGhost.PrevAngle = 0;
            yellowGhost.Sprites   = Image.FromFile("../../images/ghostYellow.png");

            //Add black ghost to board
            //black ghost
            blackGhost           = new Monster();
            blackGhost.X         = 8;
            blackGhost.Y         = 10;
            blackGhost.Angle     = 3;
            blackGhost.Wall      = 0;
            blackGhost.PrevX     = 8;
            blackGhost.PrevY     = 10;
            blackGhost.PrevAngle = 0;
            blackGhost.Sprites   = Image.FromFile("../../images/ghostBlack.png");
            #endregion
        }