Skip to content

Instantly share code, notes, and snippets.

@pyrobot
Created May 9, 2013 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyrobot/5551273 to your computer and use it in GitHub Desktop.
Save pyrobot/5551273 to your computer and use it in GitHub Desktop.
impactjs smoke test
ig.module(
'game.main'
).requires(
'impact.game'
'impact.font'
).defines ->
MyGame = ig.Game.extend
font: new ig.Font('media/04b03.font.png')
init: ->
# Initialize your game here; bind keys etc.
update: ->
# Update all entities and backgroundMaps
@parent()
draw: ->
@parent()
x = ig.system.width/2
y = ig.system.height/2
@font.draw 'It Works!', x, y, ig.Font.ALIGN.CENTER
# Start the Game with 60fps, a resolution of 320x240, scaled up by a factor of 2
ig.main '#canvas', MyGame, 60, 320, 240, 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment