Ask coding questions

← Back to all posts
Too fast
WilliamXing (41)

The snake is too fast. Why is this happening?

Answered by ia13ru (43) [earned 5 cycles]
View Answer
Comments
hotnewtop
ia13ru (43)

In line 197 to 204, I think you need to do this:

var intervalId = setInterval(function(){
//code here
}, 1000//milliseconds to wait for
);

I am not 100% sure this will work.

RoBlockHead (382)

Looks like theres no delay between loops of drawing. I haven't looked too deep into your code, but it looks like you might be able to fix it by modifying the intervalId on line 197 to have a delay there.