Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 222
    • Issues 222
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus Games
  • solarussolarus
  • Issues
  • #1276

Closed
Open
Created Sep 29, 2018 by Alex Gleason@alexgleasonContributor

Feature request: add entity:get_original_position()

I need to know the entity's position as it is saved in the map. It's trivial to implement in Lua, but having this function provided would be nice. It's low priority.

My use case is for a Gust Jar type of item. Holding the item button causes objects in its path to shiver left and right by a few pixels. When you release the button it stops. At the end it needs to return to its original position, but if it's too far to the right it'll just stay there.

Example:

voadi-vacuum-bug2

I fixed it in Lua by adding entity.original_position right before starting the animation on it, then entity:set_position() upon releasing the button.

How it's actually supposed to work:

Screencast_from_2018-09-29_15.14.05

Edited Sep 29, 2018 by Alex Gleason
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking