don't force location in continueNearGrab

This commit is contained in:
Stephen Birarda 2015-11-09 14:21:14 -08:00
parent 917b746a68
commit cea2e0fafd

View file

@ -14,18 +14,26 @@ Script.include("pitching.js");
(function() {
var pitchingMachine = null;
this.startNearGrab = this.continueNearGrab = function() {
// send the avatar to the baseball location so that they're ready to bat
MyAvatar.location = "/baseball"
this.pitchAndHideAvatar = function() {
if (!pitchingMachine) {
pitchingMachine = getOrCreatePitchingMachine();
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
}
pitchingMachine.start();
MyAvatar.shouldRenderLocally = false;
}
this.startNearGrab = function() {
// send the avatar to the baseball location so that they're ready to bat
MyAvatar.location = "/baseball"
pitchAndHideAvatar()
};
this.continueNearGrab = function() {
pitchAndHideAvatar()
}
this.releaseGrab = function() {
if (pitchingMachine) {
pitchingMachine.stop();