示例#1
0
 public MainForm(int AmountOfPlayer)
 {
     this.WindowState = FormWindowState.Maximized;
     InitializeComponent();
     this.DoubleBuffered = true;
     pf = new PlayField(AmountOfPlayer, TilesX, TilesY);
     Initialize();
     KeyDown            += MainForm_KeyPress;
     Resize             += MainForm_Resize;
     Snake.ScoreChanged += OnScoreUpdated;
     pf.gameOver        += MainForm_GameOver;
 }
示例#2
0
 public SpeedyFood(Point position, PlayField playField) : base(position, playField, Brushes.Purple)
 {
     AmountOfSpeedyFood++;
     points = 0;
     growth = 0;
 }
示例#3
0
 public StandardFood(Point position, PlayField playField) : base(position, playField, Brushes.Yellow)
 {
     AmountOfStandardFood++;
     points = 1;
     growth = 1;
 }
示例#4
0
 public ValuableFood(Point position, PlayField playField) : base(position, playField, Brushes.Orange)
 {
     AmountOfValuableFood++;
     points = 5;
     growth = 2;
 }
示例#5
0
        //private Random Random = new Random();

        public Food(Point position, PlayField playField, Brush brush)
        {
            this.position  = position;
            this.playField = playField;
            this.brush     = brush;
        }