stronger passes
This commit is contained in:
parent
344569edee
commit
2533e3c50e
@ -224,7 +224,7 @@ class Player {
|
|||||||
pass(puck, target) {
|
pass(puck, target) {
|
||||||
const direction = target.position.subtract(puck.position).normalize();
|
const direction = target.position.subtract(puck.position).normalize();
|
||||||
const distance = puck.position.distance(target.position);
|
const distance = puck.position.distance(target.position);
|
||||||
const power = Math.min(600, distance * 2);
|
const power = Math.min(800, distance * 2.5);
|
||||||
|
|
||||||
puck.velocity = direction.multiply(power);
|
puck.velocity = direction.multiply(power);
|
||||||
this.state.hasPuck = false;
|
this.state.hasPuck = false;
|
||||||
|
|||||||
@ -183,7 +183,7 @@ class Puck {
|
|||||||
this.trail = [];
|
this.trail = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
pass(target, power = 300) {
|
pass(target, power = 500) {
|
||||||
const direction = target.subtract(this.position).normalize();
|
const direction = target.subtract(this.position).normalize();
|
||||||
this.velocity = direction.multiply(power);
|
this.velocity = direction.multiply(power);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user