Skip to content

Add property "position" to FlxSprite #222

Open
@Dovyski

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions