Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save omariosouto/3f94dcf3b1ec24e92bb6d0d5d558fc1e to your computer and use it in GitHub Desktop.

Select an option

Save omariosouto/3f94dcf3b1ec24e92bb6d0d5d558fc1e to your computer and use it in GitHub Desktop.
//
// [Telas]
//
const globais = {};
let telaAtiva = {};
function mudaParaTela(novaTela) {
telaAtiva = novaTela;
if(telaAtiva.inicializa) {
telaAtiva.inicializa();
}
}
const Telas = {
INICIO: {
inicializa() {
globais.flappyBird = criaFlappyBird();
},
desenha() {
planoDeFundo.desenha();
chao.desenha();
globais.flappyBird.desenha();
mensagemGetReady.desenha();
},
click() {
mudaParaTela(Telas.JOGO);
},
atualiza() {
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment