Simple javascript game in canvas