Class: CustomEntity

CustomEntity

A custom entity.

Source:

Members

(readonly) deleting :bool

Whether the object is being deleted.

Type:
  • bool
Source:

(readonly) deletingImmediate

Whether the object is being deleted immediately.

Source:

pos :Vec2

The grid position of the entity.

Type:
Default Value:
  • new Vec2(0)
Source:

rot :number

The rotation of the entity in degrees.

Type:
  • number
Default Value:
  • 0
Source:

scl :number

The scale of the entity.

Type:
  • number
Default Value:
  • 1
Source:

script :function

The script of the entity. It is probably possible, but not recommended, to change this value.

Type:
  • function
Source:

(readonly) smoothPos :Vec2

The real position of the entity.

Type:
Source:

sprite :string

The sprite of the entity.

Type:
  • string
Default Value:
  • ""
Source:

Methods

destroy()

Deletes the entity with an animation. The entity's script will still run until the end of the animation. Calling this multiple times has no effect.

Source:

destroyImmediate()

Deletes the entity immediately without an animation. The entity's script will not run after this function is called. Calling this multiple times has no effect. The entity will be removed from the game in the next frame.

Source: