JavaScript: Dragon game