<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8" />
<script src="sample.js"></script>
<script src="jquery.js"></script>
<script src="svgpaint.js"></script>
<title>パチンコ</title>
</head>
<body onload="sample()">
<p id="memo"></p>
</body>
</html>
var x=new Array();
var y=new Array();
var c=new Array();
function sample(){
tx=0;
for (s = 1; s < 6;s++ ){
for(sx=1;sx<6;sx++){
tx=tx+1;
x[tx]=s;
y[tx]=sx;
c[tx]="red";
}
}
var timer;
var delay = 100;
var loop = function () {
n = 25 * Math.random();
ball = Math.floor(n) + 1;
c[ball] = "blue";
paint();
clearTimeout(timer);
timer = setTimeout(loop, delay);
}
loop();
}
function paint(){
var sub=new svgpaint();
str="<svg width=\"500\" height=\"500\">";
for(s=1;s<26;s++){
str=str+sub.rect(100*x[s]-100,100*y[s]-100,100,100,c[s]);
}
str=str+"</svg>";
$("#memo").html(str);
}
最終更新:2016年02月21日 12:45