Add autoplay mode
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
function Controller(selectedSong, songData){
|
||||
function Controller(selectedSong, songData, autoPlayEnabled){
|
||||
|
||||
var _this = this;
|
||||
var _backgroundURL = "/songs/"+selectedSong.folder+"/bg.png";
|
||||
@@ -8,6 +8,7 @@ function Controller(selectedSong, songData){
|
||||
|
||||
var _game = new Game(this, selectedSong, _songData);
|
||||
var _view = new View(this, _backgroundURL, selectedSong.title, selectedSong.difficulty);
|
||||
var _mekadon = new Mekadon(this, _game);
|
||||
var _keyboard = new Keyboard(this);
|
||||
var _mainLoop;
|
||||
var _pauseMenu = false;
|
||||
@@ -165,6 +166,10 @@ function Controller(selectedSong, songData){
|
||||
return _keyboard.getKeys();
|
||||
}
|
||||
|
||||
this.setKey = function(keyCode, down){
|
||||
return _keyboard.setKey(keyCode, down);
|
||||
}
|
||||
|
||||
this.getSongData = function(){
|
||||
return _game.getSongData();
|
||||
}
|
||||
@@ -209,4 +214,13 @@ function Controller(selectedSong, songData){
|
||||
_game.updateGlobalScore(score);
|
||||
}
|
||||
|
||||
this.autoPlay = function(circle){
|
||||
if(autoPlayEnabled){
|
||||
if(circle && circle.getStatus() == 450){
|
||||
_mekadon.play(circle)
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user