Created
March 6, 2020 07:26
-
-
Save rafinskipg/c633725ac84819df511fb6f81b236691 to your computer and use it in GitHub Desktop.
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
function update(dt) { | |
const speed = 100 // We can have a different speed per square if we want | |
figures.forEach(figure => { | |
figure.x = figure.x + (dt * speed ) > canvas.width ? 0 : figure.x + (dt * speed) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment