-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (29 loc) · 864 Bytes
/
index.html
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
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<title>Hero</title>
<script src="./js/animacao.js"></script>
<script src="./js/heroi.js"></script>
<script src="./js/bola.js"></script>
<script src="./js/teclado.js"></script>
</head>
<body>
<canvas id="canvas_teclado_3" width="1300" height="650"></canvas>
<script>
var canvas = document.getElementById('canvas_teclado_3');
var context = canvas.getContext('2d');
var teclado= new Teclado(document);
var animacao = new Animacao(context);
var hero = new Image();
hero.src = "img/hero.png"
var heroi = new Heroi(context, teclado, animacao, hero);
heroi.x = 600;
heroi.y = 300;
animacao.novoSprite(heroi);
animacao.ligar();
teclado.disparou(ESPACO, function(){
heroi.atirar();
});
</script>
</body>
</html>