My code when learning html5 game