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

›API del reproductor

Joc

  • Visió general
  • Objecte
  • Joc
  • Perspectiva
  • Puntuació
  • Mode épico
  • Torres

Conceptes

  • Unitats
  • Guerrer
  • Habilitats
  • Espais

API del reproductor

  • API espacial
  • API de la unitat
  • Activa l'API

Consells i trucs

  • General
  • JavaScript
  • Artificial Intelligence
  • CLI

CLI

  • Install
  • Options
Translate

API espacial

Whenever you sense an area, often one or multiple spaces (in an array) will be returned. For example, the "feel" sense in the "Baby Steps" tower returns one space:

const space = warrior.feel();

You can call methods on a space to gather information about what's there.

Class Methods

Aquests són els diferents mètodes que teniu disponibles:

space.getLocation():

Returns the relative location of this space as the number of spaces forward and to the right of your position.

Devolucions

(number[]): The relative location of this space as the offset [forward, right].

space.isEmpty():

Determines if nothing (except maybe stairs) is at this space.

Devolucions

(boolean): Whether this space is empty or not.

space.isStairs()

Determines if the stairs are at this space.

Devolucions

(boolean): Whether the stairs are at this space or not.

space.isWall()

Determines if this is the edge of the level.

Devolucions

(boolean): Whether this space is a wall or not.

space.isUnit()

Determines if there's a unit at this space.

Devolucions

(boolean): Whether a unit is at this space or not.

space.getUnit()

Returns the unit located at this space (if any).

Devolucions

(Unit): The unit at this location or undefined if there's none.

← EspaisAPI de la unitat →
  • Class Methods
    • space.getLocation():
    • space.isEmpty():
    • space.isStairs()
    • space.isWall()
    • space.isUnit()
    • space.getUnit()
WarriorJS Docs
Docs
PlayerMaker
Community
SpectrumTwitterFollow WarriorJS on Twitter
More
DonateGitHubStar