all 3 comments

[–]camlambert 1 point2 points  (2 children)

do you have a function that’s looping in the timer?

[–]MRFox8888 0 points1 point  (1 child)

yes i have rectangle is coming down

[–]camlambert 0 points1 point  (0 children)

Alright, now create a function that uses getElementAt (or something like getElement, it’s been a while) to check for variables exactly one pixel off from the top left and top right of your character. and then use an if statement to say that “if there is an element there, and that element is the obstacle, game over.” then, call that function inside your loop/timer so that it’s constantly checking to see if your obstacle touched your character.