WarriorJS Docs
  • Player
  • Maker
  • 社区
  • 中文
    • English
    • العربية
    • Català
    • Čeština
    • Deutsch
    • Ελληνικά
    • Español
    • Français
    • Italiano
    • Polskie
    • Русский
    • Српски језик (Ћирилица)
    • Svenska
    • Türkçe
    • 繁體中文
    • 帮助翻译
  • GitHub

›玩家 API

游戏

  • 概述
  • 目的
  • 游戏玩法
  • 视角
  • 得分
  • 史诗模式
  • Towers

概念

  • 单位
  • 勇士
  • 技能
  • 空格

玩家 API

  • 空间 API
  • 单元 API
  • 转变 API

提示&技巧

  • 一般
  • JavaScript
  • 人工智能
  • 命令行界面

命令行界面

  • Install
  • Options
Translate

单元 API

你可以调用 getUnit() 来获取某个空间 (space )上的东西( unit )(但是请记住,不是所有的空间上都有东西)。

const unit = space.getUnit();

你可以在一个单元上调用方法来了解更多关于它的信息。

Class Methods

以下是可供您使用的各种方法:

unit.isBound()

Determines if the unit is bound.

返回值

(boolean): Whether this unit is bound or not.

unit.isEnemy():

判断该单元是否为敌对生物。

返回值

(boolean): Whether this is an enemy unit or not.

← 空间 API转变 API →
  • Class Methods
    • unit.isBound()
    • unit.isEnemy():
WarriorJS Docs
Docs
PlayerMaker
Community
SpectrumTwitterFollow WarriorJS on Twitter
More
DonateGitHubStar