previous

page 25

next
function target() {
canvas=document.getElementById('target');
g_ctx=canvas.getContext('2d');
home();
var nmbrs=g_pattern.split('');
for (var i=0;i<4;i++) {
for (var j=0;j<5;j++) {
for (var k=0;k<nmbrs[j];k++) fd();
rt();
}
}
var w2=g_img[0].width/2;
g_ctx.drawImage(g_img[0],g_x-w2,g_y-w2);
canvas=document.getElementById('c');
g_ctx=canvas.getContext('2d');
}
index.html
<html>
...
<body onResize='resize();'>
<div id='panel1'>
<canvas id='target'></canvas>
<div id='give_up_button'>
<div id='give_up' onClick='give_up();'>GIVE UP</div>
</div>
<div id='next_button'>
<div id='next' onClick='next();'>NEXT</div>
</div>
</div>
<div id='panel2'>
...
</div>
<script>setup(); setTimeout(target,500);</script>
</body>
</html>
previous
next