mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Revert previous behavior of tadpoles to get them follow their path correctly again.
This commit is contained in:
parent
f115072e8c
commit
dfac101bfc
1 changed files with 2 additions and 2 deletions
|
@ -50,7 +50,7 @@
|
||||||
for (var i = 1; i < this.amount; i++) {
|
for (var i = 1; i < this.amount; i++) {
|
||||||
var vector = segments[i].point - point;
|
var vector = segments[i].point - point;
|
||||||
this.count += speed * 15;
|
this.count += speed * 15;
|
||||||
var wave = Math.sin((this.count + i * 3) * 0.003);
|
var wave = Math.sin((this.count + i * 3) / 300);
|
||||||
var sway = lastVector.rotate(90).normalize(wave);
|
var sway = lastVector.rotate(90).normalize(wave);
|
||||||
point += lastVector.normalize(pieceLength) + sway;
|
point += lastVector.normalize(pieceLength) + sway;
|
||||||
segments[i].point = point;
|
segments[i].point = point;
|
||||||
|
@ -155,7 +155,7 @@
|
||||||
// (1 -- based on distance, 2 -- maxSpeed)
|
// (1 -- based on distance, 2 -- maxSpeed)
|
||||||
if (slowdown && distance < 100) {
|
if (slowdown && distance < 100) {
|
||||||
// This damping is somewhat arbitrary:
|
// This damping is somewhat arbitrary:
|
||||||
desired.length = this.maxSpeed * (distance * 0.001);
|
desired.length = this.maxSpeed * (distance / 100);
|
||||||
} else {
|
} else {
|
||||||
desired.length = this.maxSpeed;
|
desired.length = this.maxSpeed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue