overte-Armored-Dragon/examples/baseball/bat.js
2015-11-02 15:34:42 -08:00

20 lines
605 B
JavaScript

(function() {
Script.include("pitching.js");
var pitchingMachine = null;
this.startNearGrab = function() {
if (!pitchingMachine) {
getPitchingMachine();
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
}
print("Started near grab!");
pitchingMachine.start();
MyAvatar.shouldRenderLocally = false;
};
this.releaseGrab = function() {
print("Stopped near grab!");
if (pitchingMachine) {
pitchingMachine.stop();
}
MyAvatar.shouldRenderLocally = true;
};
});