Add bat.js

This commit is contained in:
Ryan Huffman 2015-11-02 12:12:21 -08:00
parent 72775a7af8
commit 3820adf3f6

15
examples/baseball/bat.js Normal file
View file

@ -0,0 +1,15 @@
(function() {
Script.include("file:///c:%5CUsers%5CRyan%5Cdev%5Chifi%5Cexamples%5Cbaseball%5Cpitching.js");
var pitchingMachine = getPitchingMachine();
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
this.startNearGrab = function() {
print("Started near grab!");
pitchingMachine.start();
};
this.releaseGrab = function() {
print("Stopped near grab!");
if (pitchingMachine) {
pitchingMachine.stop();
}
};
});