Skip to content

Add property "position" to FlxSprite #222

Description

@Dovyski

There are several elements in FlxObject that have x and y properties, such as velocity, acceleration, drag and maxVelocity to name a few. They are all instances of FlxPoint, which totally makes sense.

The position of a FlxObject, however, is represented by two different Number properties. If they were represented by FlxPoint like everything else, checking the distance between two objetcs or sprites would be as easy as a.position.distance(b.position).

I suggest adding a position:FlxPoint property to FlxObject, turning the current x and y properties into getters/setters.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions