Advertisement
papyhardcore

Untitled

Feb 19th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. ig.module(
  2. 'game.main'
  3. )
  4. .requires(
  5. 'impact.game',
  6. 'impact.font',
  7. 'game.entities.Player',
  8. 'game.entities.BulletPlayer',
  9. 'game.levels.level'
  10. )
  11. .defines(function(){
  12.  
  13. MyGame = ig.Game.extend({
  14.  
  15. // Load a font
  16. font: new ig.Font( 'media/04b03.font.png' ),
  17.  
  18.  
  19. init: function() {
  20. // Initialize your game here; bind keys etc.
  21. ig.input.bind(ig.KEY.UP_ARROW,'up');
  22. ig.input.bind(ig.KEY.DOWN_ARROW,'down');
  23. ig.input.bind(ig.KEY.LEFT_ARROW,'left');
  24. ig.input.bind(ig.KEY.RIGHT_ARROW,'right');
  25. ig.input.bind(ig.KEY.A,'fire');
  26. this.loadLevel( LevelLevel );
  27.  
  28. },
  29.  
  30. update: function() {
  31. // Update all entities and backgroundMaps
  32. this.parent();
  33.  
  34. // Add your own, additional update code here
  35. },
  36.  
  37. draw: function() {
  38. // Draw all entities and backgroundMaps
  39. this.parent();
  40.  
  41.  
  42. // Add your own drawing code here
  43.  
  44. }
  45. });
  46.  
  47.  
  48. // Start the Game with 60fps, a resolution of 320x240, scaled
  49. // up by a factor of 2
  50. ig.main( '#canvas', MyGame, 60, 640, 480, 1 );
  51.  
  52. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement