Ground (functions)/Entity Movement

From PMDOWiki

GROUND:TeleportTo(RogueEssence.Ground.GroundEntity,System.Int32,System.Int32,RogueElements.Dir8,System.Int32)

Repositions the ground entity in a specified location.


Arguments

  • ent: The ground entity to reposition
  • x: The X coordinate of the destination
  • y: The Y coordinate of the destination
  • direction: The direction to point the entity. Defaults to Dir8.None, which leaves it untouched.
  • height: None

GROUND:MoveInDirection

Make ground character move in a direction.


Arguments

  • chara: Character to move
  • direction: Direction to move in
  • duration: Duration of movement, in frames
  • run: True if using a running animation, false otherwise
  • speed: Speed in pixels per frame

Example


GROUND:MoveInDirection(player, Dir8.Down, 24, false, 2)

GROUND:MoveToPosition

Make ground character move to a position.


Arguments

  • chara: Character to move
  • x: X coordinate of destination
  • y: Y coordinate of destination
  • run: True if using a running animation, false otherwise
  • speed: Speed in pixels per frame

Example


GROUND:MoveInDirection(player, 200, 240, false, 2)

GROUND:MoveToMarker

Make ground character move to a ground marker.


Arguments

  • chara: Character to move
  • mark: GroundMarker object ot move to
  • run: True if using a running animation, false otherwise
  • speed: Speed in pixels per frame

Example


GROUND:MoveInDirection(player, marker, false, 2)

GROUND:MoveObjectToPosition

Make ground object move to a position.


Arguments

  • ent: Ground Entity to move
  • x: X coordinate of destination
  • y: Y coordinate of destination
  • speed: Speed in pixels per frame

Example


GROUND:MoveInDirection(player, 200, 240, 2)

GROUND:AnimateInDirection

Make a ground character move in a direction with custom animation


Arguments

  • chara: Character to move
  • anim: Name of the animation
  • animDir: Direction of animation
  • direction: Direction to move in
  • duration: Duration of movement, in frames
  • animSpeed: Speed of animation, where 1.0 represents normal speed
  • speed: Speed movement, in pixels per frame

Example


GROUND:AnimateInDirection(player, "Hurt", Dir8.Down, 24, 0.5, 2)

GROUND:AnimateToPosition

Make a ground entity move to a position with custom animation


Arguments

  • ent: Entity to move
  • anim: Name of the animation
  • animDir: Direction of animation
  • x: X coordinate of the destination
  • y: Y coordinate of the destination
  • animSpeed: Speed of animation, where 1.0 represents normal speed
  • speed: Speed movement, in pixels per frame
  • height: Height of the destination

Example


GROUND:AnimateToPosition(player, "Hurt", Dir8.Down, 200, 240, 0.5, 2, 0)