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

Update actions moveBy, rotateBy, and scaleBy to use relative positioning #1146

Closed
eonarheim opened this issue May 3, 2019 · 0 comments · Fixed by #1158
Closed

Update actions moveBy, rotateBy, and scaleBy to use relative positioning #1146

eonarheim opened this issue May 3, 2019 · 0 comments · Fixed by #1158
Labels
api change Breaking api change core team This issue should be done by an Excalibur core member

Comments

@eonarheim
Copy link
Member

eonarheim commented May 3, 2019

Context

Currently the actions moveBy, rotateBy, and scaleBy are confusing, they move a certain quantity in a certain time. They should instead move a quantity relative to the current quantity, this is more expected.

Proposal

The method signature should also hint that things are moving by an offset moveBy(offsetX: number, offsetY: number, pixelsPerSecond: number)

moveBy(10, 10, 2) moves and actor 10 pixels to the right, and 10 pixels down at 2 pixels per second.
rotateBy(Math.PI/2, .2) rotates the actor clockwise PI/2 radians at .2 radians per second
scaleBy(1, 1, .5, .5) scales the actor 100% in the x and 100% in the y at .5 scale units per second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Breaking api change core team This issue should be done by an Excalibur core member
Projects
None yet
1 participant