Add 2-player mode

This commit is contained in:
LoveEevee
2018-09-12 20:10:00 +03:00
parent 7744fdac45
commit 8e99da6aa2
12 changed files with 813 additions and 370 deletions

View File

@@ -65,14 +65,21 @@ function Keyboard(controller){
}
this.checkMenuKeys = function(){
_gamepad.play(1)
_this.checkKey(_kbd["back"], "menu", function(){
controller.togglePause();
controller.songSelection();
})
_this.checkKey(_kbd["pause"], "menu", function(){
controller.togglePauseMenu();
})
if(!controller.multiplayer){
_gamepad.play(1)
_this.checkKey(_kbd["pause"], "menu", function(){
controller.togglePauseMenu();
})
}
if(controller.multiplayer != 2){
_this.checkKey(_kbd["back"], "menu", function(){
if(controller.multiplayer == 1){
p2.send("gameend")
}
controller.togglePause();
controller.songSelection();
})
}
}
this.checkKey = function(keyCode, keyup, callback){
@@ -85,7 +92,7 @@ function Keyboard(controller){
this.checkKeySound = function(keyCode, sound){
_this.checkKey(keyCode, "sound", function(){
assets.sounds["note_"+sound].play()
_keyTime[sound] = controller.getEllapsedTime().ms
_keyTime[sound] = controller.getElapsedTime().ms
})
}