script.js 427 B

12345678910111213141516171819
  1. var stage, controller;
  2. function init() {
  3. controller = new Controller;
  4. controller.start_game();
  5. resize();
  6. }
  7. function resize() {
  8. var height = window.innerHeight;
  9. var width = window.innerWidth;
  10. window.cell_size = height > width ?
  11. height / controller.grid_size.y :
  12. width / controller.grid_size.x;
  13. controller.stage.canvas.width = width;
  14. controller.stage.canvas.height = height;
  15. }