1 | window.setTimeout(shoulders,100)
|
---|
2 | var startPano = panorama.pano;
|
---|
3 |
|
---|
4 | var msgBox;
|
---|
5 | function shoulders(){
|
---|
6 | msgBox = document.getElementById("tutorialBox");
|
---|
7 | msgBox.innerHTML = "move your shoulders side to side to look around. <br> keep the cursor on screen to use hand controls.";
|
---|
8 | window.setTimeout(grip,6000);
|
---|
9 | }
|
---|
10 |
|
---|
11 | function grip(){
|
---|
12 | document.getElementById( "pano" ).addEventListener( "handPointerLeave", handLeft);
|
---|
13 | document.getElementById( "pano" ).addEventListener("handPointerEnter", handEntered);
|
---|
14 | console.log("added annoying hand listeners");
|
---|
15 | msgBox.innerHTML = "Close your hand into a grip and hold it to steady your view. <br> If the cursor doesn't close to a grip the kinect didn't notice so try again.";
|
---|
16 | window.addEventListener("handPointerGrip",didGrip);
|
---|
17 | }
|
---|
18 |
|
---|
19 | var oldMessage;
|
---|
20 | function handLeft() {
|
---|
21 | oldMessage = msgBox.innerHTML;
|
---|
22 | msgBox.innerHTML = "please move your hand over the screen";
|
---|
23 | }
|
---|
24 |
|
---|
25 | function handEntered() {
|
---|
26 | msgBox.innerHTML = oldMessage;
|
---|
27 | }
|
---|
28 |
|
---|
29 | function didGrip(){
|
---|
30 | window.removeEventListener("handPointerGrip", didGrip);
|
---|
31 | msgBox.innerHTML = "Great! <br> You may now move your gripped hand up and down to select and jump to distant panoramas.";
|
---|
32 | window.addEventListener("handPointerGripRelease",lostGrip);
|
---|
33 | }
|
---|
34 |
|
---|
35 | function lostGrip(){
|
---|
36 | //document.getElementById("kinectgripthing").innerHTML = jumpTargetLink;
|
---|
37 | //alert("lostGrip " + jumpTargetLink);
|
---|
38 | if(panorama.pano != startPano) {
|
---|
39 | window.removeEventListener("handPointerGripRelease", lostGrip);
|
---|
40 | //window.removeEventListener("handPointerLeave", handLeft);
|
---|
41 | //window.removeEventListener("handPointerEnter", handEntered);
|
---|
42 | msgBox.innerHTML = "Good work. This concludes the tutorial. <br> Have fun playing with the street!";
|
---|
43 | window.setTimeout(end,5000);
|
---|
44 | }
|
---|
45 | else {
|
---|
46 | window.addEventListener("handPointerGrip",didGrip);
|
---|
47 | msgBox.innerHTML = "You don't seem to be gripping; grip again to resume the tutorial.";
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|
51 | function end(){
|
---|
52 | //alert("end");
|
---|
53 | msgBox.style.display = 'none';
|
---|
54 | } |
---|