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; }
public SpeedyFood(Point position, PlayField playField) : base(position, playField, Brushes.Purple) { AmountOfSpeedyFood++; points = 0; growth = 0; }
public StandardFood(Point position, PlayField playField) : base(position, playField, Brushes.Yellow) { AmountOfStandardFood++; points = 1; growth = 1; }
public ValuableFood(Point position, PlayField playField) : base(position, playField, Brushes.Orange) { AmountOfValuableFood++; points = 5; growth = 2; }
//private Random Random = new Random(); public Food(Point position, PlayField playField, Brush brush) { this.position = position; this.playField = playField; this.brush = brush; }