Skip to content
Advertisement

Tag: setinterval

Making a analog clock by using html canvas

Below is my preliminary Javascript code for making a analog clock. My main problem is I don’t know how to clear the “previous second lines” on the clock surface: I have tried to use “ctx.globalCompositeOperation = “destination-over”;”, however not successful: Could you tell me how to clear these “previous second lines” by using globalCompositeOperation if such function can really do

SetInterval does not work well after some actions

When I press Start button it runs In my game it moves blocks from top to bottom each second. Also I have a laser which shoots and destroy blocks. When you press space key it use another laserId = setInterval(moveLaser, 100) Before you press space key blocks move well each second, but after using lazer blocks move faster then 1

Advertisement