codecombat之KithGard地牢1-18关代码分享

来源:互联网 发布:西安交大网络继续教育 编辑:程序博客网 时间:2024/05/11 09:01

codecombat中国游戏网址:http://www.codecombat.cn/

所有代码为javascript代码分享


1、Kithgard地牢

// 向宝石进发。
// 小心撞墙!
// 在下面输入你的代码。
this.moveRight();
this.moveDown();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2、深藏的宝石

// 利用你的移动命令收集所有宝石。
this.moveRight();
this.moveDown();this.moveUp();
this.moveUp();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

3、幽灵守卫

// 避开食人魔的视线,夺取宝石。
this.moveRight();
this.moveUp();
this.moveRight();
this.moveDown();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

4、健忘的宝石匠

// 夺取宝石,然后到楼梯那里去。
this.moveRight();
this.moveUp();
this.moveRight();
this.moveRight();
this.moveDown();
this.moveDown();
this.moveUp();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

5、真实姓名

// 抵抗Brak and Treg!
// 你必须攻击小食人魔两次。
this.moveRight();
this.attack("Brak");
this.attack("Brak");
this.moveRight();
this.attack("Treg");
this.attack("Treg");
this.moveRight();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

6、有利的赔率

// 攻击食人魔并收集金币。
this.moveRight();
this.attack("Krug");
this.attack("Krug");
this.moveRight();
this.moveUp();
this.attack("Grump");
this.attack("Grump");
this.moveLeft();
this.moveLeft();
this.moveLeft();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7、Kounter Kithwise

// 避免食人魔和拿走宝石。
this.moveDown();
this.moveDown();
this.moveRight();
this.moveUp();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

8、Kithgard的爬行之路

// 避免被食人魔看到.

this.moveRight();
this.moveLeft();
this.moveRight();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

9、敌人的雷区

// 使用move 命令配合参数移动的更远。
this.moveRight(3);
this.moveUp();
this.moveRight();
this.moveDown(3);
this.moveRight(2);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

10、中断虚幻

// 使用诱饵分散守卫注意力在 X 位置
this.moveRight();
this.moveDown(2);
this.moveUp(2);
this.moveRight(3);

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

11、高举之剑

// 打败食人魔
// 记住,每只攻击两次。
this.attack("Rig");
this.attack("Rig");
this.attack("Gurt");
this.attack("Gurt");
this.attack("Ack");
this.attack("Ack");

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

12、囚犯

// 从弱弱的门后面解救 Patrick
// 杀掉名为 Two 的守卫
// 得到宝石。
this.moveRight();
this.attack("Weak Door");
this.say("Hi!");
this.moveRight();
this.moveRight();
this.attack("Two");
this.attack("Two");
this.attack("Two");
this.attack("Two");
this.attack("Two");
this.attack("Two");
this.moveDown();
this.moveRight();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

13、祸之火焰

// 食人魔看上去又大又慢,这种慢速移动能力帮你避免了致命进攻。
this.shield();
this.moveRight();
this.moveRight();
loop{
    this.moveUp();
    this.moveLeft();
    this.moveDown();
    this.moveRight();
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

14、Long Kithmaze

// This is a long maze...
this.moveRight(2);
this.moveUp(2);
this.moveRight(2);
this.moveUp(2);
this.moveRight(2);
this.moveUp(2);
// Now you'll have to repeat the above steps two more times to get to the end of the maze...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

15、闹鬼迷宫

// loop 让你更容易地反复做事。
loop {
    // 在这里添加命令来重复。
    this.moveRight(2);
    this.moveUp(2);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

16、谜一般的Kithmaze

// loops 让你更容易地反复做事。
loop {
    // 此处添加loop循环的代码。
    this.moveRight();
    this.moveDown();
    this.moveRight();
    this.moveRight();
    this.moveUp();
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

17、更近一步

// 使用少于四行代码穿越迷宫
loop {
    this.moveRight(2);
    this.moveDown();
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

18、再次迷宫历险

// 使用loop循环穿越迷宫!
loop {
    this.moveRight();
    this.moveUp();
    this.moveRight();
    this.moveDown();  
}
0 0
原创粉丝点击