Skip to content

Commit

Permalink
fix: velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshd332 committed Jan 3, 2024
1 parent 5047aa3 commit 2b60d01
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/world/loaders/LoadEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export default function loadEvents(

window.addEventListener("keydown", (e) => {
if (e.key === "w" || e.key === "ArrowUp")
spaceship.velocity.translation.z = 50;
spaceship.velocity.translation.z = 20;
if (e.key === "s" || e.key === "ArrowDown")
spaceship.velocity.translation.z = -50;
spaceship.velocity.translation.z = -20;
if (e.key === "a" || e.key === "ArrowLeft")
spaceship.velocity.rotation.y = 0.03;
spaceship.velocity.rotation.y = 0.02;
if (e.key === "d" || e.key === "ArrowRight")
spaceship.velocity.rotation.y = -0.03;
if (e.key === "r") spaceship.velocity.translation.y = 30;
if (e.key === "f") spaceship.velocity.translation.y = -30;
spaceship.velocity.rotation.y = -0.02;
if (e.key === "r") spaceship.velocity.translation.y = 10;
if (e.key === "f") spaceship.velocity.translation.y = -10;
});

window.addEventListener("keyup", (e) => {
Expand Down

0 comments on commit 2b60d01

Please sign in to comment.