-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.html
46 lines (41 loc) · 1.04 KB
/
start.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
46
<html>
<head>
<script>
ship={
width:50,
height:120,
xpeed:0,
spos:360-25,
hor:360,
img:new Image()
}
function init()
{
c = document.getElementById('home');
ctx=c.getContext("2d");
h=1280;
w=720;
c.height=h;
c.width=w;
//ship.img=new Image();
ship.img.src='ship-up.png';
//grd = ctx.createLinearGradient(0, 0, w, h);
// light blue
//grd.addColorStop(0, '#8ED6FF');
// dark blue
//grd.addColorStop(1, '#004CB3');
//ctx.fillStyle = grd;
//ctx.fill();
ctx=c.getContext("2d");
//ctx.fillRect(10, 10, w-20, h-20);
console.log(ship.img, ship.spos, ship.hor,ship.width,ship.height)
//ctx.drawImage(ship.img, ship.spos, ship.hor,ship.width,ship.height);
ctx.drawImage(ship.img, 200, 200,500,500);
ctx.strokeText("NEW GAME",270,650);
}
</script>
</head>
<body onload="init()">
<canvas id="home" width="720" height="1280" style="position:absolute;border:1px solid #000000;background-color:#008AE6"></canvas>
</body>
</html>