JavaScript UI Canvas finished with snake