示例#1
0
        public OptionsForm(GameController g)
        {
            InitializeComponent();
            game = g;

            if (game.gameStick.isConnected())
            {
                game.gameStick.displayText(xAccelLabel, yAccelLabel, zAccelLabel, orientationLabel);
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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();
        }
示例#4
0
 private void initiate()
 {
     moveX = 1;
     moveY = 0;
     frameTimer = new Stopwatch();
     gameController = new GameController();
     gameInfoDTO = gameController.initiate(INITIALSNAKESIZE, Console.WindowWidth, Console.WindowHeight);
     frameTimer = new Stopwatch();
 }