mirror of
				https://github.com/flynx/Course-JavaScript.git
				synced 2025-10-31 20:10:08 +00:00 
			
		
		
		
	removed mouse control...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									6dc0dc4ec1
								
							
						
					
					
						commit
						fea40858c7
					
				| @ -1,5 +1,5 @@ | |||||||
| CACHE MANIFEST | CACHE MANIFEST | ||||||
| # Timestamp: 20170415203520 | # Timestamp: 20170420232958 | ||||||
| 
 | 
 | ||||||
| CACHE: | CACHE: | ||||||
| simplesnake.html | simplesnake.html | ||||||
|  | |||||||
| @ -348,7 +348,6 @@ function makeKeyboardHandler(snake){ | |||||||
| 		action  | 		action  | ||||||
| 			&& action[0] in snake  | 			&& action[0] in snake  | ||||||
| 			&& snake[action[0]].apply(snake, action.slice(1)) }} | 			&& snake[action[0]].apply(snake, action.slice(1)) }} | ||||||
| 
 |  | ||||||
| function makeTapHandler(snake){ | function makeTapHandler(snake){ | ||||||
| 	return function(event){ | 	return function(event){ | ||||||
| 		// prevent clicks and touches from triggering the same action 
 | 		// prevent clicks and touches from triggering the same action 
 | ||||||
| @ -369,7 +368,6 @@ function makeTapHandler(snake){ | |||||||
| 		: (event.clientX || event.changedTouches[0].pageX) <= (document.body.clientWidth / 2) ?  | 		: (event.clientX || event.changedTouches[0].pageX) <= (document.body.clientWidth / 2) ?  | ||||||
| 			Snake.left()  | 			Snake.left()  | ||||||
| 			: Snake.right() }} | 			: Snake.right() }} | ||||||
| 
 |  | ||||||
| function clearHints(){ | function clearHints(){ | ||||||
| 	document.body.classList.contains('hints') | 	document.body.classList.contains('hints') | ||||||
| 		&& document.body.classList.remove('hints') } | 		&& document.body.classList.remove('hints') } | ||||||
| @ -387,7 +385,7 @@ function setup(snake, timer, size){ | |||||||
| 		// control handlers...
 | 		// control handlers...
 | ||||||
| 		document.addEventListener('keydown', makeKeyboardHandler(snake)) | 		document.addEventListener('keydown', makeKeyboardHandler(snake)) | ||||||
| 		document.addEventListener('touchstart', makeTapHandler(snake)) | 		document.addEventListener('touchstart', makeTapHandler(snake)) | ||||||
| 		document.addEventListener('mousedown', makeTapHandler(snake)) | 		//document.addEventListener('mousedown', makeTapHandler(snake))
 | ||||||
| 
 | 
 | ||||||
| 		// cache updater...
 | 		// cache updater...
 | ||||||
| 		var appCache = window.applicationCache | 		var appCache = window.applicationCache | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user