Created
September 7, 2018 07:56
-
-
Save matrixcloud/92316b035deb5d7f4c6100208ac1e761 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
// shack screen effect | |
// @duration | |
shakeEffect: function (duration) { | |
this.node.runAction( | |
cc.repeatForever( | |
cc.sequence( | |
cc.moveTo(0.02, cc.p(5, 7)), | |
cc.moveTo(0.02, cc.p(-6, 7)), | |
cc.moveTo(0.02, cc.p(-13, 3)), | |
cc.moveTo(0.02, cc.p(3, -6)), | |
cc.moveTo(0.02, cc.p(-5, 5)), | |
cc.moveTo(0.02, cc.p(2, -8)), | |
cc.moveTo(0.02, cc.p(-8, -10)), | |
cc.moveTo(0.02, cc.p(3, 10)), | |
cc.moveTo(0.02, cc.p(0, 0)) | |
) | |
) | |
); | |
setTimeout(() => { | |
this.node.stopAllActions(); | |
this.node.setPosition(0,0); | |
}, duration*1000); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment