HilaireFernandes wrote
> First you don't need to subclass EllipseMorph...
> 100 to: 50 by: -1 do: [ :x |
> aBall
> height: x;
> bottom: 200 - x.
> World doOneCycle]
Of course you can have the best of both worlds by using Morphic stepping in
your subclass, like:
EllipseMorph subclass: #Ball
...
Ball>>#step
self
bottom: 200 - self nextHeight;
height: self nextHeight.
self bottom = 100 ifTrue: [ increment := -1 ].
self bottom = 150 ifTrue: [ increment := 1 ].
For full code:
Gofer it
smalltalkhubUser: 'SeanDeNigris' project: 'SeansPlayground';
package: 'Ball';
load.
-----
Cheers,
Sean
--
View this message in context:
http://forum.world.st/Question-on-Morphic-drawOn-method-tp4803695p4803743.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.