【codecombat】 試玩全攻略 第十六關 近戰

來源:互聯網
上載者:User

標籤:開始   攻擊   變數   http   color   英雄   att   image   分享   

 

  第十六關 近戰

  這關其實有訣竅,近戰敵人1打二下,遠程敵人2打1下。二個敵人要分開命名,不然英雄會跑回來攻擊敵人1,雖然敵人1已經死了。

不會去打敵人2,顯得很傻。所以開始吧,開幹。

  

代碼如下:

 1 hero.moveRight() 2  3 # 通過上一個關卡,你應該能認識這個。 4 enemy1 = hero.findNearestEnemy() 5 # 現在,攻擊那個變數, 6 hero.attack(enemy1) 7 hero.attack(enemy1) 8 hero.moveRight() 9 #hero.moveRight()10 enemy2 = hero.findNearestEnemy()11 hero.attack(enemy2)12 hero.moveRight()

 

 1 hero.moveRight() 2  3 # 通過上一個關卡,你應該能認識這個。 4 enemy1 = hero.findNearestEnemy() 5 # 現在,攻擊那個變數, 6 hero.attack(enemy1) 7 hero.attack(enemy1) 8 hero.moveRight() 9 hero.moveRight()10 enemy2 = hero.findNearestEnemy()11 hero.attack(enemy2)12 hero.attack(enemy2)13 hero.moveRight()14 hero.moveRight()

 

【codecombat】 試玩全攻略 第十六關 近戰

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.