// Set form size limits and create a new game instance public MainForm(string game_word, float block_accel, int spawn_interval) { this.FormClosing += new FormClosingEventHandler(MainForm_FormClosing); this.MinimumSize = new Size(Game.WIDTH, Game.HEIGHT); this.MaximumSize = new Size(Game.WIDTH, Game.HEIGHT); this.game = new Game(game_word, block_accel, spawn_interval); Graphics g = CreateGraphics (); game.startGraphics (g); }
// Start a new gameplay rendering thread, public void init(Game game) { this.game = game; renderThread = new Thread (new ThreadStart (render)); renderThread.Start (); }