Direction: Choose the correct option
Q1.
How do you create animations in canvas?
Direction: Choose the correct option
Q2.
function animate() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
// drawing code
requestAnimationFrame(animate);
}Why is clearRect needed?Direction: Choose the correct option
Q3.
What is requestAnimationFrame used for?
Direction: Choose the correct option
Q4.
How do you update an object's position for animation?
Direction: Choose the correct option
Q5.
What happens if you animate without clearing the canvas?
