Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: TopDownMoveComponent

[16:7] extends: Component

Wraps FXGL's TopDownMoveComponent (com.almasb.fxgl.dsl.components.TopDownMoveComponent), the classic 4-direction (left/right/up/down) mover for top-down games. Bind moveLeft / moveRight / moveUp / moveDown to input actions.

Methods

  • TopDownMoveComponent (double Speed = 100.0)

    Creates a new TopDownMoveComponent.

    • @p Speed is the move speed in pixels per second.
  • adopt (object Ajo)

    Wraps an existing TopDownMoveComponent AussomJavaObject.

  • getSpeed ()

  • setSpeed (double V)

  • moveLeft ()

    Moves the entity one step left (blocked by collidables).

  • moveRight ()

  • moveUp ()

  • moveDown ()

  • collidables (list TypeEnums)

    Registers the collidable type tags. The entity will not step into a tile that contains an entity whose type matches one of the supplied values.

    • @p TypeEnums is a list of enum AJOs (or any value usable as an entity type).