How would you implement Morph>>#moveTo:inSteps: in Pharo Smalltalk? Assume a hard-coded delay between steps. And don't necessarily worry about updating the World (i.e. say it will be forked in the background). I'm only concerned with the algorithm.
From https://stackoverflow.com/a/17906567/424245, I came up with:
Morph>>#moveTo: pointB inSteps: anInteger
| deltaX deltaY |
deltaX := (pointB x - self center x) / anInteger.
deltaY := (pointB y - self center y) / anInteger.
anInteger timesRepeat: [
self align: self center with: self center + (deltaX @ deltaY).
10 milliSeconds asDelay wait ].
But I'm wondering if there's something I'm missing in core that and reinventing the wheel...