HTML and CSS Reference
In-Depth Information
function splitRock(scale,x,y){
for (var newRockctr=0;newRockctr<2;newRockctr++){
var newRock = {};
//ConsoleLog.log("split rock");
if (scale==2){
newRock.scoreValue = medRockScore;
newRock.width = 32;
newRock.height = 32;
newRock.halfWidth = 16;
newRock.halfHeight = 16;
newRock.hitWidth = 24;
newRock.hitHeight = 24;
}else {
newRock.scoreValue = smlRockScore;
newRock.width = 24;
newRock.height = 24;
newRock.halfWidth = 12;
newRock.halfHeight = 12;
newRock.hitWidth = 16;
newRock.hitHeight = 16;
}
newRock.scale = scale;
newRock.x = x;
newRock.y = y;
newRock.dx = Math.random()*3;
if (Math.random()<.5){
newRock.dx *= -1;
}
newRock.dy = Math.random()*3;
if (Math.random()<.5){
newRock.dy *= -1;
}
if (Math.random()<.5){
newRock.rotationInc = -1;
}else{
newRock.rotationInc = 1;
}
newRock.animationDelay = Math.floor(Math.random()*3+1);
newRock.animationCount = 0;
newRock.rotation = 0;
ConsoleLog.log("new rock scale"+(newRock.scale));
rocks.push(newRock);
}
}
Search WWH ::




Custom Search