Created
October 23, 2017 21:17
-
-
Save lonekorean/9953131ac673c734963268aefdc9535e to your computer and use it in GitHub Desktop.
Matter.js beforeUpdate event
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
Matter.Events.on(engine, 'beforeUpdate', function(event) { | |
if (pinball.position.x > 450 && pinball.velocity.y > 0) { | |
Matter.Body.setVelocity(pinball, { x: 0, y: -10 }); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment