Browse Source

Basketball game: fix

customisations
alemart 8 months ago
parent
commit
df2ba098e4
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      demos/basketball/src/entities/ball.js

+ 1
- 1
demos/basketball/src/entities/ball.js View File

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

Loading…
Cancel
Save