View: Add touch controls

This commit is contained in:
LoveEevee
2018-10-05 20:03:59 +03:00
parent 724c82814e
commit c8acfc3188
12 changed files with 362 additions and 33 deletions

View File

@@ -1,9 +1,10 @@
class Controller{
constructor(selectedSong, songData, autoPlayEnabled, multiplayer){
constructor(selectedSong, songData, autoPlayEnabled, multiplayer, touchEnabled){
this.selectedSong = selectedSong
this.songData = songData
this.autoPlayEnabled = autoPlayEnabled
this.multiplayer = multiplayer
this.touchEnabled = touchEnabled
this.snd = this.multiplayer ? "_p" + this.multiplayer : ""
var backgroundURL = "/songs/" + this.selectedSong.folder + "/bg.png"
@@ -202,6 +203,9 @@ class Controller{
}
}
clean(){
if(this.syncWith){
this.syncWith.clean()
}
this.stopMainLoop()
this.keyboard.clean()
this.view.clean()