previous

page 18

next
home()
function home() {
g_ctx.clearRect(0,0,g_side,g_side);
g_x=g_x0; g_y=g_y0; g_h=0;
robot();
}
run()
function run() {
home();
Hide('run'); Hide('cont'); Show('stop');
g_running=true;
g_i=0; g_j=0; g_k=0;
setTimeout(one_step,500);
}
stop()
function stop() {
clearTimeout(g_timer);
Hide('cont'); Hide('stop'); Show('run');
if (g_i<4 && g_running) Show('cont');
g_running=false;
}
previous
next