Created
March 14, 2012 05:53
-
-
Save richtaur/2034407 to your computer and use it in GitHub Desktop.
Part of a polish tutorial
This file contains hidden or 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
// Have the heart container "pop" in | |
polish.popIn(this, bind(this, function () { | |
// Wait a moment, then start to flicker away… then disappear | |
var numFlashes = 20; | |
this.numFlashes = 1; | |
// Wait 1 second | |
this.delayTween(1000); | |
// Add flashes to the queue | |
for (var i = 0; i < numFlashes; ++i) { | |
this.delayTween((30 - i) * 6, bind(this, function () { | |
// Toggle opacity | |
this.opacity = this.opacity == 1 ? 0 : 1; | |
// Gone through all the flashes? Then remove it | |
if (++this.numFlashes == numFlashes) { | |
this.remove(); | |
} | |
})); | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yay XOR