• 【网易官方】极客战记(codecombat)攻略-游戏开发1-投火


    关卡连接:https://codecombat.163.com/play/level/throwing-fire

    免费试玩:https://codecombat.163.com/play

    Okar 有些游戏对象可以设置属性。

    简介

    有些游戏对象可以设置属性。

    "fire-spewer" 能喷射火球!

    默认喷射方向是 "horizontal" (横向)。

    你可以将属性改为 "vertical" ,让其纵向喷射,代码如下:

    spew = game.spawnXY("fire-spewer", 40, 40)
    spew.direction = "vertical"

    默认代码

    # 游戏对象可以设置属性。

     # 不要改变这个,它是设置游戏的。

    player = game.spawnPlayerXY("knight", 40, 10)
    game.addCollectGoal()
    game.addSurviveGoal()

    game.spawnXY("gem", 32, 55)

    game.spawnXY("gem", 51, 55)

     
    fs1 = game.spawnXY("fire-spewer", 12, 25)
    fs2 = game.spawnXY("fire-spewer", 70, 30)
    fs3 = game.spawnXY("fire-spewer", 12, 35)
    fs4 = game.spawnXY("fire-spewer", 70, 40)

    # 将fs1.direction改成"vertical":

    fs1.direction = "horizontal" # ∆ Change this.

     # 再将fs2.direction改成"vertical":

     # fs3和fs4也这样做:

     # 下面开始游戏并收集宝石!

    概览

    Coming soon!

    投火 解法

    # 游戏对象可以设置属性。
    # 不要改变这个,它是设置游戏的。
    player = game.spawnPlayerXY("knight", 40, 10)
    game.addCollectGoal()
    game.addSurviveGoal()
    game.spawnXY("gem", 32, 55)
    game.spawnXY("gem", 51, 55)
    fs1 = game.spawnXY("fire-spewer", 12, 25)
    fs2 = game.spawnXY("fire-spewer", 70, 30)
    fs3 = game.spawnXY("fire-spewer", 12, 35)
    fs4 = game.spawnXY("fire-spewer", 70, 40)
    # 将fs1.direction改成"vertical":
    fs1.direction = "vertical"
    # 再将fs2.direction改成"vertical":
    fs2.direction = "vertical"
    # fs3和fs4也这样做:
    fs3.direction = "vertical"
    fs4.direction = "vertical"
    # 下面开始游戏并收集宝石!
     

    本攻略发于极客战记官方教学栏目,原文地址为:

    https://codecombat.163.com/news/jikezhanji-touhuo

    极客战记——学编程,用玩的!
     
  • 相关阅读:
    HRBUST--2317 Game(完全背包)
    k8s的回滚应用
    python练习-2
    k8s HA 补充-(keepalived+haproxy配置)
    Etcd故障恢复记录
    kubernetes 1.14安装部署helm插件
    k8s Prometheus+CAdvisor+node_export+grafana
    k8s ingress部署
    k8s pvc
    k8s pv
  • 原文地址:https://www.cnblogs.com/codecombat/p/12124033.html
Copyright © 2020-2023  润新知