Quellcode durchsuchen

Basketball game: fix

customisations
alemart vor 8 Monaten
Ursprung
Commit
df2ba098e4
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1
    1
      demos/basketball/src/entities/ball.js

+ 1
- 1
demos/basketball/src/entities/ball.js Datei anzeigen

@@ -149,6 +149,7 @@ export class Ball extends Entity
149 149
 
150 150
             if(position.x > 60) {
151 151
                 impostor.mass = 1; // enable gravity
152
+                this._positionWhenThrown.copyFrom(mesh.absolutePosition);
152 153
                 this._state = 'throwing';
153 154
             }
154 155
         }
@@ -209,7 +210,6 @@ export class Ball extends Entity
209 210
             -magnitude * Math.cos(SHOOT_ANGLE)
210 211
         );
211 212
 
212
-        this._positionWhenThrown.copyFrom(this._mesh.absolutePosition);
213 213
         this._mesh.physicsImpostor.applyImpulse(impulse, this._mesh.absolutePosition);
214 214
         this._state = 'thrown';
215 215
     }

Laden…
Abbrechen
Speichern