Tweak tutorial to add delays between steps

This commit is contained in:
Ryan Huffman 2016-09-16 09:00:13 -07:00
parent c84ccaaac0
commit c95b694524
2 changed files with 23 additions and 18 deletions

View file

@ -319,7 +319,7 @@ stepOrient.prototype = {
this.overlay = new StayInFrontOverlay("model", { this.overlay = new StayInFrontOverlay("model", {
url: "http://hifi-content.s3.amazonaws.com/alan/dev/Prompt-Cards/welcome.fbx?11", url: "http://hifi-content.s3.amazonaws.com/alan/dev/Prompt-Cards/welcome.fbx?11",
ignoreRayIntersection: true, ignoreRayIntersection: true,
}, 2, { x: 0, y: 0.3, z: 0 }); }, 1.5, { x: 0, y: 0.3, z: 0 });
// Spawn content set // Spawn content set
//spawnWithTag(HandsAboveHeadData, defaultTransform, tag); //spawnWithTag(HandsAboveHeadData, defaultTransform, tag);
@ -387,18 +387,20 @@ stepRaiseAboveHead.prototype = {
editEntitiesWithTag(this.tag, { visible: true }); editEntitiesWithTag(this.tag, { visible: true });
this.checkIntervalID = null; Script.setTimeout(function() {
function checkForHandsAboveHead() { this.checkIntervalID = null;
print("Checking for hands above head..."); function checkForHandsAboveHead() {
if (MyAvatar.getLeftPalmPosition().y > (MyAvatar.getHeadPosition().y + 0.1)) { print("Checking for hands above head...");
Script.clearInterval(this.checkIntervalID); if (MyAvatar.getLeftPalmPosition().y > (MyAvatar.getHeadPosition().y + 0.1)) {
this.checkIntervalID = null; Script.clearInterval(this.checkIntervalID);
playSuccessSound(); this.checkIntervalID = null;
//location = "/tutorial"; playSuccessSound();
onFinish(); //location = "/tutorial";
onFinish();
}
} }
} this.checkIntervalID = Script.setInterval(checkForHandsAboveHead.bind(this), 500);
this.checkIntervalID = Script.setInterval(checkForHandsAboveHead.bind(this), 500); }.bind(this), 2000);
}, },
cleanup: function() { cleanup: function() {
if (this.checkIntervalID != null) { if (this.checkIntervalID != null) {
@ -729,17 +731,20 @@ stepEquip.prototype = {
print("Got message", channel, message, sender, MyAvatar.sessionUUID); print("Got message", channel, message, sender, MyAvatar.sessionUUID);
if (channel == "Tutorial-Spinner") { if (channel == "Tutorial-Spinner") {
if (this.currentPart == this.PART1 && message == "wasLit") { if (this.currentPart == this.PART1 && message == "wasLit") {
this.currentPart = this.PART2; Script.setTimeout(function() {
hideEntitiesWithTag(this.tagPart1); this.currentPart = this.PART2;
showEntitiesWithTag(this.tagPart2); hideEntitiesWithTag(this.tagPart1);
setControllerPartLayer('tips', 'grip'); showEntitiesWithTag(this.tagPart2);
Messages.subscribe('Hifi-Object-Manipulation'); setControllerPartLayer('tips', 'grip');
Messages.subscribe('Hifi-Object-Manipulation');
}.bind(this), 2000);
} }
} else if (channel == "Hifi-Object-Manipulation") { } else if (channel == "Hifi-Object-Manipulation") {
if (this.currentPart == this.PART2) { if (this.currentPart == this.PART2) {
var data = parseJSON(message); var data = parseJSON(message);
print("Here", data.action, data.grabbedEntity, this.gunID); print("Here", data.action, data.grabbedEntity, this.gunID);
if (data.action == 'release' && data.grabbedEntity == this.gunID) { if (data.action == 'release' && data.grabbedEntity == this.gunID) {
print("got release");
this.stopWatchingGun(); this.stopWatchingGun();
try { try {
Messages.messageReceived.disconnect(this.onMessage); Messages.messageReceived.disconnect(this.onMessage);

View file

@ -165,4 +165,4 @@
} }
return new Fire(); return new Fire();
}); });