mirror of
				https://github.com/flynx/Course-JavaScript.git
				synced 2025-10-29 19:10:09 +00:00 
			
		
		
		
	added 'paused' indicator...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									fea40858c7
								
							
						
					
					
						commit
						8d61d19bde
					
				| @ -1,5 +1,5 @@ | ||||
| CACHE MANIFEST | ||||
| # Timestamp: 20170420232958 | ||||
| # Timestamp: 20170420234350 | ||||
| 
 | ||||
| CACHE: | ||||
| simplesnake.html | ||||
|  | ||||
| @ -90,6 +90,21 @@ body { | ||||
| 	background-color: red; | ||||
| } | ||||
| 
 | ||||
| .simplesnake.stopped:before { | ||||
| 	content: "Paused..."; | ||||
| 	position: absolute; | ||||
| 	display: block; | ||||
| 	width: 100%; | ||||
| 	top: 50%; | ||||
| 	margin-top: -10vmin; | ||||
| 	font-size: 10vmin; | ||||
| 	font-weight: bolder; | ||||
| 	text-align: center; | ||||
| 	color: rgba(0, 0, 0, 0.2); | ||||
| 	z-index: 100; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| /* | ||||
| .simplesnake .apple { | ||||
| 	position: relative; | ||||
|  | ||||
| @ -287,6 +287,7 @@ var Snake = { | ||||
| 			.snakeKilled(null) | ||||
| 	}, | ||||
| 	start: function(t){ | ||||
| 		this._field.classList.remove('paused') | ||||
| 		this.__timer = this.__timer  | ||||
| 			|| setInterval(this._tick.bind(this), t || this.config.interval || 200) | ||||
| 		// reset player control actions...
 | ||||
| @ -297,6 +298,7 @@ var Snake = { | ||||
| 		return this | ||||
| 	}, | ||||
| 	stop: function(){ | ||||
| 		this._field.classList.add('paused') | ||||
| 		clearInterval(this.__timer) | ||||
| 		delete this.__timer | ||||
| 		delete this.__tick | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user