-
Notifications
You must be signed in to change notification settings - Fork 1
/
sketch.js
36 lines (32 loc) · 779 Bytes
/
sketch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function setup() {
createCanvas(windowWidth, windowHeight);
telaInicial = new TelaInicial()
historia = new Historia()
creditos = new Creditos()
jogo = new Jogo()
cenas = {
telaInicial,
historia,
creditos,
jogo
}
jogo.setup()
botaoHistoria = new BotaoHistoria('História', width / 2, height / 2)
botaoCreditos = new BotaoCreditos('Créditos', width / 2, height / 2)
botaoIniciar = new BotaoIniciar('Iniciar', width / 2, height / 2)
botaoVoltar = new BotaoVoltar('Voltar', width /2, height / 2)
frameRate(40)
somDoJogo.loop();
}
function keyPressed() {
jogo.keyPressed(key)
}
function keyReleased(){
jogo.keyReleased(key)
}
function draw() {
// if(cenaAtual === 'jogo') {
// jogo.draw()
// }
cenas[cenaAtual].draw()
}