CHAPTER 3
Code Explanation
nballx = inboxboundx
ballvx = -ballvx;
}
if (nbally > boxboundy) {
nbally = boxboundy;
ballvy =-ballvy;
}
if (nbally < inboxboundy) {
nbally = inboxboundy;
ballvy = -ballvy;
}
ballx = nballx;
bally = nbally;
}
function change() {
ballvx = Number(f.hv.value);
ballvy = Number(f.vv.value);
return false;