codecombat之KithGard地牢19-37关代码分享
来源:互联网 发布:linus和linux区别 编辑:程序博客网 时间:2024/04/27 03:39
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精通
// 使用移动命令到达迷宫的终点。
// 计算你收集到的宝石数量,然后在到达火球陷阱时通过说出当前的宝石数量来使陷阱失效。
// 在起点的地方会有一只乌鸦告诉你一个密码。在门的附近说出该密码来开门。
// 当你靠近食人魔时杀死它。
// 你可以在需要的时候使用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);
所有代码为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精通
// 使用移动命令到达迷宫的终点。
// 计算你收集到的宝石数量,然后在到达火球陷阱时通过说出当前的宝石数量来使陷阱失效。
// 在起点的地方会有一只乌鸦告诉你一个密码。在门的附近说出该密码来开门。
// 当你靠近食人魔时杀死它。
// 你可以在需要的时候使用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);
1 0
- codecombat之KithGard地牢19-37关代码分享
- codecombat之KithGard地牢1-18关代码分享
- codecombat安息之云山峰37-40及地牢42关代码分享
- codecombat之边远地区的森林1-11关及地牢38关代码分享
- codecombat之边远地区的森林12-22关及地牢39关代码分享
- codecombat之边远地区的森林23-30关及地牢40\41关代码分享
- 【CodeCombat-Python】地牢-kithgard 斗殴
- codecombat之Sarven沙漠25-37关代码分享
- codecombat之Sarven沙漠1-12关代码分享
- codecombat安息之云山峰22-31关代码分享
- codecombat安息之云山峰41关代码分享
- codecombat之Sarven沙漠13-24关及森林45/46关代码分享
- codecombat安息之云山峰1-10关及森林47/48关代码分享
- codecombat安息之云山峰11-21关及沙漠38关代码分享
- codecombat安息之云山峰32-36关及森林49关代码分享
- codecombat之边远地区的森林31-44关代码分享
- 地牢第一关(Python)
- 分享codecombat游戏第一章关卡精通代码JavaScript
- UIViewController
- inline函数和宏函数的区别
- 数据结构之顺序表
- 整数对A满足二叉查找树,B满足最大堆
- 2016阿里巴巴c/c++研发工程师在线笔试题(选择题)
- codecombat之KithGard地牢19-37关代码分享
- Application
- Android ImageLoader(Android-Universal-Image-Loader)【1】概述及使用简介
- SQL总结——基本查询
- [php]Undefined offset: 0错误
- java学习个人笔记---Java内存管理之java对象内存中的状态
- Volley StringRequest和JSONObjectRequest使用几个细节
- 搭建园区拓扑
- 封装XML或Json通信数据