Simple JavaScript version of snake game based on html canvas