From a7ceb0233363469598effb20a1312a525afb8b68 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sun, 27 Jun 2021 14:52:23 +0000 Subject: [PATCH] Movimiento a partir de tiempo --- src/jugando.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jugando.js b/src/jugando.js index 7083cf9..59bd4b0 100644 --- a/src/jugando.js +++ b/src/jugando.js @@ -18,12 +18,12 @@ export function createJugandoState() { export function updateJugando(juego, dt) { juego.state.velocity.x = 0 if (juego.keyboard.keys.d) { - juego.state.velocity.x += 20 + juego.state.velocity.x += 200 } if (juego.keyboard.keys.a) { - juego.state.velocity.x -= 20 + juego.state.velocity.x -= 200 } - juego.state.pos.x += juego.state.velocity.x + juego.state.pos.x += (dt / 1000) * juego.state.velocity.x } function drawBackground(juego, y, height, img) {