Next step in tutorial
This commit is contained in:
		
							parent
							
								
									718e6f88b8
								
							
						
					
					
						commit
						05f47aa5e7
					
				
							
								
								
									
										4
									
								
								js/prototype/Coin.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								js/prototype/Coin.js
									
									
									
									
										vendored
									
									
								
							| @ -1,7 +1,8 @@ | |||||||
| var Coin = function(x,y,z) { | var Coin = function(x,y,z, callback) { | ||||||
|     this.ready = false; |     this.ready = false; | ||||||
|     this.got = false; |     this.got = false; | ||||||
|     this.init(x,y,z); |     this.init(x,y,z); | ||||||
|  |     this.callback = callback; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| var _toto = new Audio(); | var _toto = new Audio(); | ||||||
| @ -41,6 +42,7 @@ Coin.prototype.update = function() { | |||||||
| Coin.prototype.get = function() { | Coin.prototype.get = function() { | ||||||
|     if (!this.got) { |     if (!this.got) { | ||||||
|         this.got = true; |         this.got = true; | ||||||
|  |         this.callback(); | ||||||
|         if (this.mesh) { |         if (this.mesh) { | ||||||
|             this.mesh.visible = false; |             this.mesh.visible = false; | ||||||
|         } |         } | ||||||
|  | |||||||
							
								
								
									
										16
									
								
								js/prototype/TutorialSteps.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								js/prototype/TutorialSteps.js
									
									
									
									
										vendored
									
									
								
							| @ -17,7 +17,11 @@ var TutorialSteps = function(tutoCamera) { | |||||||
|             justclick: true |             justclick: true | ||||||
|         }, |         }, | ||||||
|         { |         { | ||||||
|             text:"Nice !", |             text: "Here is a red coin, click on it !", | ||||||
|  |             justclick: false | ||||||
|  |         }, | ||||||
|  |         { | ||||||
|  |             text:"Nice ! You can try to use the keyboard arrows to move the camera", | ||||||
|             justclick: true |             justclick: true | ||||||
|         } |         } | ||||||
|     ]; |     ]; | ||||||
| @ -31,7 +35,15 @@ TutorialSteps.prototype.nextStep = function() { | |||||||
|             case 0: break; |             case 0: break; | ||||||
|             case 1: this.camera.allowed.mouseRotate       = true; break; |             case 1: this.camera.allowed.mouseRotate       = true; break; | ||||||
|             case 2: this.camera.allowed.keyboardRotate    = true; break; |             case 2: this.camera.allowed.keyboardRotate    = true; break; | ||||||
|             case 3: this.camera.allowed.keyboardTranslate = true; break; |             case 3: | ||||||
|  |                 this.camera.allowed.keyboardRotate    = true; | ||||||
|  |                 var self = this; | ||||||
|  |                 coins.push(new Coin(0.4911245636058468,1.225621525492101,-5.11526684540265, function() { | ||||||
|  |                     self.nextStep(); | ||||||
|  |                 })); | ||||||
|  |                 coins[coins.length-1].addToScene(scene); | ||||||
|  |                 break; | ||||||
|  |             case 4: this.camera.allowed.keyboardTranslate = true; break; | ||||||
|         } |         } | ||||||
|         this.step++; |         this.step++; | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								js/prototype/tutorial.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								js/prototype/tutorial.js
									
									
									
									
										vendored
									
									
								
							| @ -122,6 +122,8 @@ function init() { | |||||||
| 
 | 
 | ||||||
|     // Add listeners
 |     // Add listeners
 | ||||||
|     initListeners(); |     initListeners(); | ||||||
|  | 
 | ||||||
|  |     tutorial.nextStep(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function initListeners() { | function initListeners() { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user