Skip to content

Commit

Permalink
feat: make gliding a bit faster (no performance change, just behaviour)
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlw committed Oct 28, 2024
1 parent 979b918 commit fb71043
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions birdman.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ AFRAME.registerComponent('birdman', {
dir.y -= vspeed * timeDelta / 1000;

// slow down horizontal movement with some resistance
let slow_down_factor = 0.98;
if (this.dir.length() * 1000 / timeDelta > hspeed) {
let slow_down_factor = 0.99;
if (this.dir.length() * 1000 / timeDelta > 2 * hspeed) {
this.dir.x *= slow_down_factor;
this.dir.z *= slow_down_factor;
}
Expand All @@ -78,7 +78,7 @@ AFRAME.registerComponent('birdman', {
this.rigPos.add(this.dir);

// add part of the controller direction to the gliding direction
let factor = 0.3;
let factor = 1;
this.dir.x += dir.x * factor;
this.dir.z += dir.z * factor;
},
Expand Down

0 comments on commit fb71043

Please sign in to comment.