Clean up classes before exiting them

This commit is contained in:
LoveEevee
2018-09-18 01:37:59 +03:00
parent f19fbf5371
commit e8809285e0
25 changed files with 1183 additions and 1172 deletions

View File

@@ -1,17 +1,19 @@
function Tutorial() {
var _this = this;
this.run = function() {
assets.sounds["bgm_setsume"].playLoop(0.1, false, 0, 1.054, 16.054)
$('#tutorial-end-button').click(function(){
assets.sounds["bgm_setsume"].stop();
assets.sounds["don"].play();
localStorage.setItem('tutorial', 'true');
new SongSelect();
});
};
$('#screen').load('/src/views/tutorial.html', _this.run);
};
class Tutorial{
constructor(){
loader.changePage("tutorial")
assets.sounds["bgm_setsume"].playLoop(0.1, false, 0, 1.054, 16.054)
this.endButton = document.getElementById("tutorial-end-button")
pageEvents.once(this.endButton, "click").then(this.onEnd.bind(this))
}
onEnd(){
this.clean()
assets.sounds["don"].play()
localStorage.setItem("tutorial", "true")
new SongSelect()
}
clean(){
assets.sounds["bgm_setsume"].stop()
pageEvents.remove(this.endButton, "click")
delete this.endButton
}
}