public OptionsForm(GameController g) { InitializeComponent(); game = g; if (game.gameStick.isConnected()) { game.gameStick.displayText(xAccelLabel, yAccelLabel, zAccelLabel, orientationLabel); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SnakeForm snakeForm = new SnakeForm(); GameController game = new GameController(snakeForm); snakeForm.game = game; game.start(); Application.Run(snakeForm); }
public GameStick(GameController _game) { game = _game; demoMode = false; port = new SerialPort(); port.BaudRate = 128000; port.DataReceived += port_DataReceived; timer = new Timer(); timer.Interval = 20; timer.Tick += new EventHandler(tick); timer.Start(); }
private void initiate() { moveX = 1; moveY = 0; frameTimer = new Stopwatch(); gameController = new GameController(); gameInfoDTO = gameController.initiate(INITIALSNAKESIZE, Console.WindowWidth, Console.WindowHeight); frameTimer = new Stopwatch(); }