Newbie question about moving morphs programmatically

Josh Gargus schwa at fastmail.us
Sat Sep 25 16:10:31 UTC 2004


Try add the method

wantsSteps

	^ true

Joshua

On Sep 25, 2004, at 10:59 AM, Anders Conradi wrote:

> Hi,
>
> I am new to this list, squeak and smalltalk in general. I am sorry if 
> this is the wrong list for this kind of questions, but I don't know 
> where else to ask.
>
> I have a simple morph that I want to move by a velocity vector 
> (expressed as a Point). The velocity is expressed in the global 
> coordinate system. What is the proper method for moving the morph? I 
> have tried
>
> localVelocity
> 	^(self globalPointToLocal: self velocity) - (self globalPointToLocal: 
> 0 at 0).
>
> step
> 	self center: self center + (self localVelocity * (self stepTime * 
> 0.001))
>
> and
>
> step
> 	self center: self center + (self velocity * (self stepTime * 0.001))
>
> In both cases "self velocity" returns the velocity as a Point.
>
> I am sure the answer is really easy to find, but I don't know where to 
> look.
>
> Thankful for any answers,
> /Anders Conradi
>
>




More information about the Squeak-dev mailing list