Tetris/JavaScript: Difference between revisions

m
→‎Code: remove dead code
m (→‎Code: small changes)
m (→‎Code: remove dead code)
Line 6:
<lang javascript><!DOCTYPE html>
<html lang='en'>
 
<head>
<meta charset='UTF-8'>
Line 19 ⟶ 20:
</style>
</head>
 
<body>
<canvas></canvas>
Line 98 ⟶ 100:
case 'ArrowLeft':
if (canMove(fallingShape, left))
move(fallingShape, left);
break;
 
Line 104 ⟶ 106:
case 'ArrowRight':
if (canMove(fallingShape, right))
move(fallingShape, right);
break;
 
Line 112 ⟶ 114:
fastDown = true;
while (canMove(fallingShape, down)) {
move(fallingShape, down);
draw();
}
Line 164 ⟶ 166:
}
 
function move(s, dir) {
fallingShapeRow += dir.y;
fallingShapeCol += dir.x;
Line 469 ⟶ 471:
 
if (canMove(fallingShape, down)) {
move(fallingShape, down);
} else {
shapeHasLanded();
Line 515 ⟶ 517:
 
</body>
 
</html></lang>
Anonymous user