Small JS dragon game with loops (if,while,for)