Commit 63d0138d authored by gj4210's avatar gj4210 👽 Committed by janis.streib
Browse files

FIX: Use window.requestAnimationFrame for animation

parent 0f1c2c36
......@@ -27,19 +27,19 @@ export default {
return {
running: true,
frameInterval: 1000 / 30, // 30 FPS
baseSpeed: 5,
xspeed: 5,
yspeed: 5,
baseSpeed: 3,
xspeed: 3,
yspeed: 3,
hue: Math.random() * 256,
clicks: 0,
scoreL: 4,
scoreR: 4,
dirL: 0,
dirR: 0,
paddleSpeed: 20,
paddleSpeed: 16,
game: false,
speedIncreaseFactor: 5,
speedIncreaseBase: 5,
speedIncreaseFactor: 3,
speedIncreaseBase: 3,
subText: 'Ungültige URL!'
}
},
......@@ -118,7 +118,7 @@ export default {
paddleR.style.top = parseInt(paddleR.style.top) + this.dirR * this.paddleSpeed + 'px'
}
setTimeout(this.animate, this.frameInterval)
window.requestAnimationFrame(this.animate)
}
},
random_color() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment