예제 #1
0
 public void Notify(Model m)
 {
     if (m is SnakeGameModel)
     {
         SnakeGameModel sbm = m as SnakeGameModel;
         SetScore((sbm.SnakeLength() - SnakeGameModel.SNAKE_INIT_SIZE).ToString());
     }
 }
예제 #2
0
        public void Notify(Model m)
        {
            // if it's a SnakeBoardModel, then we know how to handle it
            if (m is SnakeGameModel)
            {
                sbm = (SnakeGameModel)m;
                if (sbm.isHit)
                {
                    controller.Stop();
                    MessageBox.Show("Game over!!, your score is " + (sbm.SnakeLength() - SnakeGameModel.SNAKE_INIT_SIZE));
                }

                if (sbm.isEating)
                {
                    Snake.Debug("Eating");
                }
            }
        }