BlueGit

blue-star speeltuin

fix compounding tonguelengthbounce when not precisely 0

timfa wsadhelios · pushed by timfa

Authored 2022-10-19 · 4 years ago

Hash
6ab63ebff44bf240d7595b80e3e7e02f4b863736
Parent
360893e3
1 file changed +3 −1
src/minigame/frog/frog.js +3 −1
@@ -62,6 +62,8 @@ class Frog extends GameObject {
62 62 else
63 63 {
64 64 this.retracting = false;
65 this.tongueLength = 0;
66 this.tongueLengthBounce = 0;
65 67 }
66 68 }
67 69
@@ -91,7 +93,7 @@ class Frog extends GameObject {
91 93
92 94 if(this.should_bounce)
93 95 {
94 if(!(this.tongueLengthBounce > 0))
96 if((this.tongueLengthBounce <= 0))
95 97 {
96 98 this.tongueVectorBounceOrigin = this.tongueVector.getCopy();
97 99 }
@@ -62,6 +62,8 @@ class Frog extends GameObject {
62 else
62 else
63 {
63 {
64 this.retracting = false;
64 this.retracting = false;
65 this.tongueLength = 0;
66 this.tongueLengthBounce = 0;
65 }
67 }
66 }
68 }
67
69
@@ -91,7 +93,7 @@ class Frog extends GameObject {
91
93
92 if(this.should_bounce)
94 if(this.should_bounce)
93 {
95 {
94 if(!(this.tongueLengthBounce > 0))
96 if((this.tongueLengthBounce <= 0))
95 {
97 {
96 this.tongueVectorBounceOrigin = this.tongueVector.getCopy();
98 this.tongueVectorBounceOrigin = this.tongueVector.getCopy();
97 }
99 }