mirror of
https://github.com/flynx/Slang.git
synced 2025-10-29 02:30:08 +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
|
CACHE MANIFEST
|
||||||
# Timestamp: 20170420232958
|
# Timestamp: 20170420234350
|
||||||
|
|
||||||
CACHE:
|
CACHE:
|
||||||
simplesnake.html
|
simplesnake.html
|
||||||
|
|||||||
@ -90,6 +90,21 @@ body {
|
|||||||
background-color: red;
|
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 {
|
.simplesnake .apple {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -287,6 +287,7 @@ var Snake = {
|
|||||||
.snakeKilled(null)
|
.snakeKilled(null)
|
||||||
},
|
},
|
||||||
start: function(t){
|
start: function(t){
|
||||||
|
this._field.classList.remove('paused')
|
||||||
this.__timer = this.__timer
|
this.__timer = this.__timer
|
||||||
|| setInterval(this._tick.bind(this), t || this.config.interval || 200)
|
|| setInterval(this._tick.bind(this), t || this.config.interval || 200)
|
||||||
// reset player control actions...
|
// reset player control actions...
|
||||||
@ -297,6 +298,7 @@ var Snake = {
|
|||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
stop: function(){
|
stop: function(){
|
||||||
|
this._field.classList.add('paused')
|
||||||
clearInterval(this.__timer)
|
clearInterval(this.__timer)
|
||||||
delete this.__timer
|
delete this.__timer
|
||||||
delete this.__tick
|
delete this.__tick
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user