mirror of
https://github.com/sigmasternchen/Wish
synced 2025-03-15 15:38:54 +00:00
fix for snake (sry bitowl)
This commit is contained in:
parent
cffcd435d7
commit
10c608e039
1 changed files with 4 additions and 1 deletions
|
@ -106,7 +106,8 @@ SnakeClass.prototype.tick = function(){
|
||||||
|
|
||||||
if(this.gameState == this.INGAME){
|
if(this.gameState == this.INGAME){
|
||||||
|
|
||||||
var input=this.stdin.read();
|
var input=this.stdin.read(1);
|
||||||
|
input = input.charCodeAt(0);
|
||||||
if(input){
|
if(input){
|
||||||
var changedword=false;
|
var changedword=false;
|
||||||
|
|
||||||
|
@ -151,11 +152,13 @@ SnakeClass.prototype.tick = function(){
|
||||||
}
|
}
|
||||||
}else if(this.gameState==this.INTRO){
|
}else if(this.gameState==this.INTRO){
|
||||||
var input=this.stdin.read();
|
var input=this.stdin.read();
|
||||||
|
input = input.charCodeAt(0);
|
||||||
if(input){
|
if(input){
|
||||||
this.startGame();
|
this.startGame();
|
||||||
}
|
}
|
||||||
}else if(this.gameState==this.GAMEOVER){
|
}else if(this.gameState==this.GAMEOVER){
|
||||||
var input=this.stdin.read();
|
var input=this.stdin.read();
|
||||||
|
input = input.charCodeAt(0);
|
||||||
if(input){
|
if(input){
|
||||||
if(input==this.QUIT){
|
if(input==this.QUIT){
|
||||||
this.quitGame();
|
this.quitGame();
|
||||||
|
|
Loading…
Reference in a new issue