예제 #1
0
        private void mapBox_Paint(object sender, PaintEventArgs e)
        {
            g = e.Graphics;
            if (mouse == null)
            {
                mouse = new MouseController(g, cellSize, myMap, this, cat);
            }
            else
            {
                mouse.DrawMouse(g);
            }

            if (cat == null)
            {
                cat = new CatController(g, cellSize, myMap, this, mouse);
            }
            else
            {
                cat.DrawCat(g);
            }
            // draw the paving slabs
            foreach (Cell myCell in myMap)
            {
                myCell.drawBackground(g);
            }

            mouse.Cat          = cat;
            su                 = new ScoreInfoEventArgs();
            mouse.ScoreChange += new ScoreChangeEventHandler(ChangeScore);
            gameRunning        = true;
        }
예제 #2
0
        protected virtual void ChangeScore(object sender, ScoreInfoEventArgs e)
        {
            Control[] scoreBox = Controls.Find("scoreBox", false);

            scoreBox[0].Text = e.score.ToString();
        }