Untitled


SUBMITTED BY: Guest

DATE: Nov. 13, 2013, 9:40 a.m.

FORMAT: Text only

SIZE: 879 Bytes

HITS: 2938

  1. <canvas id="game" width="568" height="320"></canvas>
  2. var GAME = {
  3. settings: {
  4. canvas: document.getElementById('game'),
  5. context: this.canvas.getContext('2d'),
  6. gameWidth: this.context.width,
  7. gameHeight: this.context.height
  8. }
  9. };
  10. var GAME = {
  11. settings: {
  12. canvas: document.getElementById('game');
  13. }
  14. };
  15. GAME.settings.context = GAME.settings.canvas.getContext('2d');
  16. GAME.settings.gameWidth = GAME.settings.context.width;
  17. GAME.settings.gameHeight = GAME.settings.context.height;
  18. var GAME = (function(){
  19. var s = {};
  20. s.canvas = document.getElementById('game');
  21. s.context = s.canvas.getContext('2d');
  22. s.gameWidth = s.context.width;
  23. s.gameHeight = s.context.height;
  24. return { settings : s}
  25. })();

comments powered by Disqus