Hellow I work on a splash screen? I worked on making a new scene now it's making the transition I wonder actually likes..hum the 'timer I was wondering if the logics was good.
constructor() {
super();
this.loadSprite();
this._timer = 0;
}
loadSprite(){
let spriteContainer = [ "LogoBackground", "Logo", "Particles"];
for (let i in spriteContainer) {
ImageManager.loadTitle(spriteContainer);
}
}
create(){
super.create();
this.createBackground();
this.createLogo();
}
start(){
super.start();
SceneManager.clearStack();
this.centerSprite(this._background);
this.playLogoMe();
this.startFadeIn(this.fadeSpeed(), false);
}
update(){
if(!this.isBusy()){
this.updateTimer();
}
super.update();
}
updateTimer(){
if(this._timer <= 0){
this._timer++;
} else if (this._timer >= 1000){
this.fadeOutAll();
SceneManager.goto(Scene_Title);
}
if (Input.isRepeated('ok')){
this._timer = 1000;
}
}
OBVIOUSLY it's written in Typescript but after it's just ES6 syntax...
thanks for your further answer 🙂
I mean if you can help me to improve the method c:
constructor() {
super();
this.loadSprite();
this._timer = 0;
}
loadSprite(){
let spriteContainer = [ "LogoBackground", "Logo", "Particles"];
for (let i in spriteContainer) {
ImageManager.loadTitle(spriteContainer);
}
}
create(){
super.create();
this.createBackground();
this.createLogo();
}
start(){
super.start();
SceneManager.clearStack();
this.centerSprite(this._background);
this.playLogoMe();
this.startFadeIn(this.fadeSpeed(), false);
}
update(){
if(!this.isBusy()){
this.updateTimer();
}
super.update();
}
updateTimer(){
if(this._timer <= 0){
this._timer++;
} else if (this._timer >= 1000){
this.fadeOutAll();
SceneManager.goto(Scene_Title);
}
if (Input.isRepeated('ok')){
this._timer = 1000;
}
}
OBVIOUSLY it's written in Typescript but after it's just ES6 syntax...
thanks for your further answer 🙂
I mean if you can help me to improve the method c: