Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 32 lines (25 sloc) 0.736 kB
70655cb @iph ANDREW
iph authored
1 class Introduction {
2 HTMLCanvasElement canvas;
3 CanvasRenderingContext2D ctx;
4 HTMLImageElement img;
066e8ec intro music
Andrew Tribone authored
5 HTMLAudioElement audio;
70655cb @iph ANDREW
iph authored
6
066e8ec intro music
Andrew Tribone authored
7 Introduction(this.audio){
70655cb @iph ANDREW
iph authored
8 canvas = window.document.getElementById('canvas');
9 ctx = canvas.getContext('2d');
10 img = window.document.createElement('img');
11 img.src = "images/instructions.png";
12 img.onload = (e){
13 ctx.drawImage(img, 0 , 0);
14 canvas.onmousedown = clickListener;
15
16 };
17 }
18
19
20 //
21 void clickListener(MouseEvent e){
22 if(e.offsetX >= 276 && e.offsetX <= (276+113) && e.offsetY >= 576 && e.offsetY <= (576+192)){
23 ctx.clearRect(0,0,canvas.width, canvas.height);
24 canvas.onmousedown = (e){};
066e8ec intro music
Andrew Tribone authored
25 audio.pause();
70655cb @iph ANDREW
iph authored
26 new Game();
27 }
28
29 }
30 }
31
Something went wrong with that request. Please try again.