Rename getPitchingMachine to getOrCreatePitchingMachine

This commit is contained in:
Ryan Huffman 2015-11-09 10:10:59 -08:00
parent 30841169ee
commit 20bdc7ee85
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@
this.startNearGrab = function() {
print("Started near grab!");
if (!pitchingMachine) {
pitchingMachine = getPitchingMachine();
pitchingMachine = getOrCreatePitchingMachine();
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
}
pitchingMachine.start();
@ -12,7 +12,7 @@
};
this.continueNearGrab = function() {
if (!pitchingMachine) {
pitchingMachine = getPitchingMachine();
pitchingMachine = getOrCreatePitchingMachine();
Script.update.connect(function(dt) { pitchingMachine.update(dt); });
}
pitchingMachine.start();

View file

@ -80,14 +80,14 @@ var PITCHING_MACHINE_PROPERTIES = {
z: 0.39
},
collisionsWillMove: false,
shapeType: "Box",
shapeType: "Box"
};
PITCHING_MACHINE_PROPERTIES.dimensions = Vec3.multiply(2.5, PITCHING_MACHINE_PROPERTIES.dimensions);
var DISTANCE_FROM_PLATE = PITCHING_MACHINE_PROPERTIES.position.z;
var PITCH_RATE = 5000;
getPitchingMachine = function() {
getOrCreatePitchingMachine = function() {
// Search for pitching machine
var entities = findEntities({ name: PITCHING_MACHINE_PROPERTIES.name }, 1000);
var pitchingMachineID = null;