making a snake game using javascript