Skip to content

Instantly share code, notes, and snippets.

@mrjoshida
Created July 9, 2016 02:52
Show Gist options
  • Save mrjoshida/6f7ebc9d989e19f0620395228c6248a3 to your computer and use it in GitHub Desktop.
Save mrjoshida/6f7ebc9d989e19f0620395228c6248a3 to your computer and use it in GitHub Desktop.
Commonly used GameLab code snippets
// Create a sprite for each wall and add them to the group walls
// You can then use sprite.bounceOff(walls)
var walls = createGroup();
var top = createSprite(200, 0, 400, 5);
walls.add(top);
var bottom = createSprite(200, 400, 400, 5);
walls.add(bottom);
var left = createSprite(0, 200, 5, 400);
walls.add(left);
var right = createSprite(400, 200, 5, 400);
walls.add(right);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment