script.js 674 B

1234567891011121314151617181920212223242526272829
  1. var stage, controller;
  2. function init() {
  3. controller = new Controller;
  4. resize();
  5. controller.start_game();
  6. /*var p2 = new Particle({x: 3, y: 3});
  7. p2.start_time = createjs.Ticker.getTime();
  8. p2.target = {
  9. time: p2.start_time + 1000,
  10. x: 10,
  11. y: 7
  12. }
  13. var p2v = new ParticleView(p2);
  14. controller.add_view(p2v);*/
  15. }
  16. function resize() {
  17. var height = window.innerHeight;
  18. var width = window.innerWidth;
  19. window.cell_size = height > width ?
  20. height / controller.grid_size.y :
  21. width / controller.grid_size.x;
  22. controller.stage.canvas.width = width;
  23. controller.stage.canvas.height = height;
  24. }