forked from paulorpdl/codigoTaller2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
29 lines (24 loc) · 737 Bytes
/
app.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
var canvas = document.getElementById('fondo');
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.strokeStyle = "black";
ctx.fillStyle = "blue";
ctx.arc(150, 200, 50, 0, Math.PI*2, false);
ctx.stroke();
ctx.fill();
ctx.closePath();
ctx.beginPath();
ctx.fillStyle = "black";
ctx.font = "25pt Arial";
ctx.fillText("Hola Canvas-Mundo", 300, 100);
ctx.closePath();
var assetManager = new AssetManager();
assetManager.queueDownload("./imagenes/vaca_normal.png","vacanormal");
assetManager.downloadAll(function() {
var imagen = assetManager.getAsset("vacanormal");
ctx.drawImage(imagen, 500,225);
var juego = new Juego(ctx);
var circulo = new Circulo(juego, 0, 225);
juego.addEntidad(circulo);
juego.iniciar();
});