Changed song selection screen

This commit is contained in:
LoveEevee
2018-09-26 21:30:57 +03:00
parent 74a9813c14
commit 71e180c7d7
16 changed files with 1663 additions and 428 deletions

View File

@@ -2,13 +2,24 @@ class Titlescreen{
constructor(){
loader.changePage("titlescreen")
this.titleScreen = document.getElementById("title-screen")
pageEvents.keyOnce(this, 13, "down").then(this.goNext.bind(this))
pageEvents.once(this.titleScreen, "click").then(this.goNext.bind(this))
pageEvents.keyOnce(this, 13, "down").then(this.onPressed.bind(this))
pageEvents.once(this.titleScreen, "click").then(this.onPressed.bind(this))
assets.sounds["title"].play()
this.gamepad = new Gamepad({
"start": ["b", "x", "y", "start"],
"a": ["a"]
}, (pressed, key) => {
if(pressed){
this.onPressed()
}
})
}
goNext(){
onPressed(){
this.clean()
assets.sounds["don"].play()
setTimeout(this.goNext.bind(this), 500)
}
goNext(){
if(localStorage.getItem("tutorial") !== "true"){
new Tutorial()
} else {
@@ -16,6 +27,7 @@ class Titlescreen{
}
}
clean(){
this.gamepad.clean()
assets.sounds["title"].stop()
pageEvents.keyRemove(this, 13)
pageEvents.remove(this.titleScreen, "click")