-
-
Save Awea/9c7e4f0ac42b8a7fe337 to your computer and use it in GitHub Desktop.
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
class ChildrenFilter | |
@byName: (children, name) -> | |
$.grep(children, (child) -> | |
return child.name == name | |
)[0] | |
@byNameOrCreate: (game, stage, children, name) -> | |
byName = @byName(children, name) | |
byName = if typeof byName == 'undefined' then false else byName | |
if byName | |
byName | |
else | |
new Phaser.Group(game, stage, name, true) |
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
class CanvasTweens | |
@starsBlink: (context, stars) -> | |
stars.forEach((star) -> | |
@game.add.tween(star).to({ | |
alpha: 0 | |
}, @game.rnd.integerInRange(600, 1500), null, true, @game.rnd.integerInRange(800, 1500), -1, true) | |
, context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment