Created
July 9, 2016 02:52
-
-
Save mrjoshida/6f7ebc9d989e19f0620395228c6248a3 to your computer and use it in GitHub Desktop.
Commonly used GameLab code snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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