added crouch based alt fire for guns

This commit is contained in:
landgreen
2019-09-14 09:13:00 -07:00
parent 01a596dc22
commit a16bfedfbd
5 changed files with 66 additions and 66 deletions

View File

@@ -263,7 +263,7 @@ const mech = {
}
//come to a stop if fast or if no move key is pressed
if (player.speed > 4) {
const stoppingFriction = (this.crouch) ? 0.7 : 0.89;
const stoppingFriction = (this.crouch) ? 0.65 : 0.89; // this controls speed when crouched
Matter.Body.setVelocity(player, {
x: player.velocity.x * stoppingFriction,
y: player.velocity.y * stoppingFriction
@@ -333,7 +333,7 @@ const mech = {
}
//come to a stop if fast or if no move key is pressed
if (player.speed > 4) {
const stoppingFriction = (this.crouch) ? 0.7 : 0.89;
const stoppingFriction = (this.crouch) ? 0.65 : 0.89;
Matter.Body.setVelocity(player, {
x: player.velocity.x * stoppingFriction,
y: player.velocity.y * stoppingFriction