codecombat之KithGard地牢19-37关代码分享
codecombat中国游戏网址:http://www.codecombat.cn/
全部代码为javascript代码分享
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19、恐惧之门
// 攻击大门(Door)
// 须要攻击非常多次,请使用loop循环
loop{
var enemy=this.findNearestEnemy();
if(enemy){
this.attack(enemy);
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20、了解敌人
// 你能够用名称标签作为变量。
var enemy1 = "Kratt";
var enemy2 = "Gert";
var enemy3 = "Ursa";
loop{
if(enemy1||enemy2||enemy3){
this.attack(enemy1);
this.attack(enemy2);
this.attack(enemy3);
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21、Robot Ragnarok
// The robot ragnarok is upon us!
// Dodge the incoming plasma balls for 15 seconds.
// If you can beat it before August 26, you'll earn Wyvernclaw, a legendary wizard-only weapon.
// Wyvernclaw will not be available after August 26.
this.moveUp(2);
this.moveDown(2);
this.moveLeft();
this.moveRight();
this.moveDown(2);
this.moveRight();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22、Kithgard的橱柜
// 首先,移动到橱柜。
this.moveUp();
this.moveRight(2);
this.moveDown();
this.moveDown();
// 然后,使用循环攻击 橱柜
loop {
this.attack("Cupboard");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23、不祥的征兆
// 你的目标是保护地图右边的人存活。
// 你不须要和食人巨怪打。仅仅管逃命!你的盟友会保护你。
this.moveRight(2);
this.moveUp();
this.moveRight(3);
this.moveDown();
this.moveRight();
this.moveDown();
this.moveRight();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24、名字大师
// 你的英雄不知道这些敌人的名字。
// 这眼镜给了你寻找近期敌人的能力。
loop {
var enemy1 = this.findNearestEnemy();
this.attack(enemy1);
this.attack(enemy1);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25、攻破突袭
// 你能够在循环前写代码
// 使用循环逃离迷宫
this.moveRight();
this.moveUp();
this.attack("Chest");
this.moveDown();
loop {
// 移动3次
this.moveRight(3);
this.moveDown(3);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26、击溃
// 释放你的盟友,清理出一条路来逃亡!
this.moveRight();
this.attack("Weak Door");
this.moveRight();
this.moveDown();
loop {
this.attack("Door");
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27、卑微的Kithmen
// 创建第二个变量并攻击它.
var enemy1 = this.findNearestEnemy();
this.attack(enemy1);
this.attack(enemy1);
var enemy2 = this.findNearestEnemy();
this.attack(enemy2);
this.attack(enemy2);
this.moveRight();
this.moveDown();
this.moveRight();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28、近战
this.moveRight();
// 通过上一个关卡。你应该能认识这个。
var enemy1 = this.findNearestEnemy();
// 如今,攻击那个变量。
this.attack(enemy1);
this.attack(enemy1);
this.moveRight(2);
var enemy2 = this.findNearestEnemy();
this.attack(enemy2);
this.moveRight();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29、战术打击
// 成功击败全部食人魔
this.moveUp();
this.moveRight(3);
this.moveDown(2);
var enemy1 = this.findNearestEnemy();
this.attack(enemy1);
var enemy2 = this.findNearestEnemy();
this.attack(enemy2);
this.moveLeft();
this.moveDown();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30、The Skeleton
//须要换一身好一些的装备
// Use a loop to attack the skeleton.
// Its blunt sword hardly does any damage, but it has huge knockback.
loop {
var enemy = this.findNearestEnemy();
this.attack(enemy);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31、A Mayhem of Munchkins
// Inside a loop, use findNearestEnemy and attack!
loop {
var enemy = this.findNearestEnemy();
if(enemy){
this.attack(enemy);
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32、明智的攻击
// Avoid all the fire-traps
// 假设你踩到火焰陷阱,你会烧到。
// 提示1:越大的敌人。血越厚
// 提示2:你不须要杀死全部的食人魔假设你认为你不够强大的话
// 移动到近期的门
// 用命令 this.attack('门的名字')来打破这个门
// 进入房间
// 攻击房间内的敌人(怎样攻击一个没有名字的敌人?)
this.moveUp(2);
this.attack("Door A");
this.moveUp(2);
var enemy1 = this.findNearestEnemy();
this.attack(enemy1);
this.attack(enemy1);
this.attack(enemy1);
this.attack(enemy1);
this.moveDown(3);
this.moveRight(2);
this.moveUp();
this.attack("Door B");
this.moveUp(2);
var enemy2 = this.findNearestEnemy();
this.attack(enemy2);
this.attack(enemy2);
this.moveDown(2);
this.moveRight(2);
this.attack("Door C");
this.moveUp(2);
var enemy3 = this.findNearestEnemy();
this.attack(enemy3);
this.attack(enemy3);
this.attack(enemy3);
this.attack(enemy3);
this.moveDown(2);
this.moveRight(2);
var enemy4 = this.findNearestEnemy();
this.attack(enemy4);
this.attack(enemy4);
var enemy5 = this.findNearestEnemy();
this.attack(enemy5);
this.attack(enemy5);
this.moveUp(3);
this.moveRight();
this.moveDown(4);
this.moveLeft(3);
this.moveDown();
this.moveLeft(2);
// 移动到宝石处
// 攻击敌人
// 得到宝石
// 如今让我们跑吧(移动到 x 标记的位置)
// 再来一次,躲避全部的火焰陷阱
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33、最后的Kithman族
// 使用loop循环移动并攻击目标
loop {
this.moveRight();
this.moveUp();
var enemy = this.findNearestEnemy();
this.attack(enemy);
this.moveRight();
this.moveDown(2);
this.moveUp();
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34、Kithgard之门
// 建造三个栅栏来隔离兽人。
this.moveDown();
this.buildXY("fence", 36, 34);
this.buildXY("fence", 36, 30);
this.buildXY("fence", 36, 26);
this.moveRight(4);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35、真正的挑战
//注意使用钻石升级装备,提高攻击力
// 使用你刚学到的技能击败那些食人魔。
loop {
this.moveRight();
var enemy = this.findNearestEnemy();
this.attack(enemy);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
36、辐射灵气
// 捡起发光的石头,让骷髅敌人远离你一会儿。
loop {
this.moveUp();
this.moveDown();
this.moveRight(2);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37、Kithgard精通
// 使用移动命令到达迷宫的终点。
// 计算你收集到的宝石数量。然后在到达火球陷阱时通过说出当前的宝石数量来使陷阱失效。
// 在起点的地方会有一仅仅乌鸦告诉你一个password。在门的附近说出该password来开门。
// 当你靠近食人魔时杀死它。
// 你能够在须要的时候使用loop来反复全部的指令。
// 假设你通过了这个关卡,你就能够直接跳到边远地区的森林!
this.moveUp();
this.moveRight(3);
this.moveUp();
this.moveDown();
this.moveRight();
this.say("Swordfish");
this.moveRight(2);
this.moveUp();
this.say("1");
this.moveUp(2);
var enemy1 = this.findNearestEnemy();
this.attack(enemy1);
this.attack(enemy1);
this.moveLeft(4);
this.moveUp(3);
this.moveRight(3);
this.moveUp();
this.moveDown();
this.moveRight();
this.say("Swordfish");
this.moveRight(2);
this.moveUp();
this.say("2");
this.moveUp(2);
var enemy2 = this.findNearestEnemy();
this.attack(enemy2);
this.attack(enemy2);
this.moveLeft(4);
codecombat之KithGard地牢19-37关代码分享的更多相关文章
- codecombat之边远地区的森林12-22关及地牢39关代码分享
codecombat中国游戏网址:http://www.codecombat.cn/ 全部代码为javascript代码分享 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
- codecombat之边远地区的森林1-11关及地牢38关代码分享
codecombat中国游戏网址:http://www.codecombat.cn/ 全部代码为javascript代码分享 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
- CodeCombat代码全记录(Python学习利器)--Kithgard地牢代码1
Kithgard地牢注意:在调用函数时,要在函数的后面加上括号内容,否则在python中,将不会认为你在调用这个函数内容,而你的英雄将像木头一样站在原地不会执行上左下右的移动!!! hero.move ...
- [Python] Codecombat 攻略 Sarven 沙漠 (1-43关)截止至30关
首页:https://cn.codecombat.com/play语言:Python 第二界面:Sarven沙漠(43关)时间:4-11小时内容:算术运算,计数器,while循环,break(跳出循环 ...
- [Python] Codecombat 攻略 Sarven 沙漠 (1-43关)截止至36关
首页:https://cn.codecombat.com/play语言:Python 第二界面:Sarven沙漠(43关)时间:4-11小时内容:算术运算,计数器,while循环,break(跳出循环 ...
- 网易极客战记官方攻略-地牢-Kithgard 地牢
关卡连接: https://codecombat.163.com/play/level/dungeons-of-kithgard 夺取宝石,逃出地牢--注意不要触碰其他东西.在这个关卡里,你会学习编写 ...
- 37行代码实现一个简单的打游戏AI
不废话,直接上码,跟神经网络一点关系都没有,这37行代码只能保证电脑的对敌牺牲率是1:10左右,如果想手动操控,注释掉autopilot后边的代码即可. 哪个大神有兴趣可以用tensorflow或者s ...
- jQuery实现的手机发送验证码倒计时效果代码分享
这是一款基于jquery实现的手机发送验证码倒计时效果代码,可实现实时显示秒数倒计时的功能,还可实现对手机号码格式验证的功能,是一款常用的网站注册发送手机验证码特效代码. 效果描述:注册一个网站,当需 ...
- 前端常用得CSS代码分享
前端常用得CSS代码分享 本文首发于公众号:小夭同学,同步更新个人博客:故事影片,转载请署名.代码不断更新中!! 1,垂直居中对齐 .vc { position: absolute; top: 50% ...
随机推荐
- JPA设置表名和实体名,表字段与实体字段的对应
转自:https://blog.csdn.net/LQW_java_home/article/details/53079363 首先 你的jpaProperties配置项中要有 <prop ke ...
- 深入理解 python 元类
一.什么的元类 # 思考: # Python 中对象是由实例化类得来的,那么类又是怎么得到的呢? # 疑问: # python 中一切皆对象,那么类是否也是对象?如果是,那么它又是那个类实例化而来的呢 ...
- 如何用jquery+ajax写省市区的三级联动?(封装和不封装两种方式)-----2017-05-14
首先,要实现如下图效果, 1.要理清思路: 先做出三个下拉菜单----根据第一个下拉菜单的value值获取第二个下拉列表的内容,第三个同理. 2.用到的数据库表:Chinastates表 规律:根据国 ...
- (C++)错误提示 c2352 :非静态成员函数的非法调用
静态成员函数相当于全局函数,只是有一个类名字空间的限制.而类成员函数是成员内部的函数,同一个类的对象实例可以有很多,每一个实例都有自已不同的成员变量值,成员函数一般都是对成员自已的成员变量值在操作.所 ...
- 7) 十分钟学会android--Activity的生命周期之暂停与恢复
在正常使用app时,前端的activity有时会被其他可见的组件阻塞(obstructed),从而导致当前的activity进入Pause状态.例如,当打开一个半透明的activity时(例如以对话框 ...
- 页面footer在底部
页脚动态贴在底部需要满足以下两个条件: 当主体的内容高度不超过可视区域高度的时候,页脚贴在页面底部. 当主体的内容高度超过可视区域高度的时候,页脚将按正常布局. 方法一:footer高度固定+绝对定位 ...
- 解决strip: Unable to recognise the format of the input file问题
前言 在编译xilinx的uboot的时候出现了一个问题,始终报错:“strip: Unable to recognise the format of the input file `gen_et ...
- CentOS6.5 静默安装Oracle 11g过程中提示:Exception in thread “main” java.lang.NoClassDefFoundError
原来是系统中设置了DISPLAY环境变量,执行: [oracle@qa26 database]$ ./runInstaller -silent -responseFile /usr/local/or ...
- day25-2 random,os,sys模块
目录 random 为什么要有random模块,random模块有什么用 os 为什么要有os模块,os模块有什么用 sys 为什么要有sys模块,sys模块有什么用 random import ra ...
- 洛谷P1120 小木棍 [数据加强版]搜索
玄学剪支,正好复习一下搜索 感觉搜索题的套路就是先把整体框架打出来,然后再一步一步优化剪枝 1.从maxv到sumv/2枚举长度(想一想,为什么) 2. 开一个桶,从大到小开始枚举 3. 在搜索中,枚 ...