Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add property "position" to FlxSprite #222

Open
Dovyski opened this issue Nov 15, 2014 · 4 comments
Open

Add property "position" to FlxSprite #222

Dovyski opened this issue Nov 15, 2014 · 4 comments

Comments

@Dovyski
Copy link
Member

Dovyski commented Nov 15, 2014

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.

@greysondn
Copy link

I will at least agree that I've found that property odd for some time.

The actual change is fairly simple, all things considered. Are we now 3.0 and okay with breaking API?

@Dovyski
Copy link
Member Author

Dovyski commented Dec 30, 2014

I was not planning to break the API because the x and y properties would still be there, both internally getting position.x and posision.y.

Version 3.0 will definitely break the API since several classes have been moved into new packages. That's the reason why we bumped the version number from 2.58 to 3.0.

@Dovyski Dovyski added this to the Future release milestone Jan 11, 2015
@greysondn
Copy link

... Deprecation warnings?

@Dovyski
Copy link
Member Author

Dovyski commented Jan 14, 2015

Yes, we introduced them for 3.0 to ensure a smoother transition. Take a look at this, for instance.

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

No branches or pull requests

2 participants