第二章 邊遠地區的森林 羊腸小道
按照藍色箭頭的提示,我們的英雄需要走到上面第一顆寶石處,再移動到下面第二顆寶石處,最后在X位置
用hero.buildXY("fence"x,y)命令修一個圍欄。把獸人攔在小道里面。但這樣就拿不到右上角的四顆寶石了。
這怎么能難倒我呢,當我拿到四顆寶石,隨后就在身后建了一個圍欄,哈哈哈,雖然我出不來了,但英雄安全,
寶石拿到。成功!
代碼如下:
1 # 到小路的盡頭去,並在那兒修一個柵欄。 2 # 利用你的 moveXY(x, y)坐標移動功能。 3 4 # It's the first point of the path.
5 # Move at the next points of the path.
6 hero.moveXY(36, 60)
7 # Build a fence to stop the ogre.
8 hero.moveXY(37, 14)
9 hero.moveXY(74, 62)
10 hero.buildXY("fence", 72, 60) 11 12 #想了解codecombat最全最好玩的攻略內容,歡迎訪問節點親王的博客園! 13 #轉載請注明出處,否則作者有權追究法律責任!