Changed song selection screen
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user