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

›Maker API

Guide

  • Introduction
  • Creating Your Tower
  • Adding Levels
  • Defining Abilities
  • Defining Units
  • Refactoring
  • Testing
  • Publishing

Maker API

  • Space API
  • Unit API
Edit

Space API

As a maker, you call the same methods the player call on a sensed space, but on a regular space.

Class Methods

Here are the various methods that are available to you:

space.isEmpty():

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

Returns

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

space.isStairs()

Determines if the stairs are at this space.

Returns

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

space.isWall()

Determines if this is the edge of the level.

Returns

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

space.isUnit()

Determines if there's a unit at this space.

Returns

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

space.getUnit()

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

This unit will be a regular unit, not a sensed unit.

Returns

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

Instance Properties

location (number[])

The absolute location of this space as the pair of coordinates [x, y].

← PublishingUnit API →
  • Class Methods
    • space.isEmpty():
    • space.isStairs()
    • space.isWall()
    • space.isUnit()
    • space.getUnit()
  • Instance Properties
    • location (number[])
WarriorJS Docs
Docs
PlayerMaker
Community
SpectrumTwitterFollow WarriorJS on Twitter
More
DonateGitHubStar