<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class="">
<div class="">LEnglish</div><div class=""><a href="mailto:LEnglish5@cox.net" class="">LEnglish5@cox.net</a></div><div class=""><br class=""></div><br class="Apple-interchange-newline">

</div><div class="">Unfortunately, can’t run that without windows, if I read the title correctly (“for windows”)</div><div class=""><br class=""></div><div class="">Also, I was using OpenGL, which might have complicated things.</div><div class=""><br class=""></div><div class="">Thanks for the link. I’ll try to figure out what they did differently than my experiment.</div><div class=""><br class=""></div><div class="">L</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Oct 12, 2017, at 16:09, Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com" class="">cunningham.cb@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Lawson,<div class=""><br class=""></div><div class="">Actually smooth animation in Squeak is possible.  The best I've seen is at:</div><div class=""><a href="http://www.zogotounga.net/comp/saucers.htm" class="">http://www.zogotounga.net/comp/saucers.htm</a><br class=""></div><div class="">This is pure squeak/morphic, using stepping.</div><div class=""><br class=""></div><div class="">This isn't to say there aren't issue lurking about, of course.</div><div class=""><br class=""></div><div class="">-cbc</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Oct 12, 2017 at 3:41 PM, LEnglish <span dir="ltr" class=""><<a href="mailto:LEnglish5@cox.net" target="_blank" class="">LEnglish5@cox.net</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class="">
<div class=""><br class=""></div><div class=""><br class=""></div>Because of garbage collection issues, smooth animation in Squeak isn’t really possible.</div><div class=""><br class=""></div><div class="">My little OpenGL spaceship firing a missile animation had this annoying pause every so-often, as the GC activated and froze the screen.</div><div class=""><br class=""></div><div class="">Was hoping that Craig Latta would release a minimal Spoon image that allowed me to load the OpenGL plugin code, because the GC in the minimal image took about 1/50th (or less) of the time that the complete image takes, but he got sidetracked with his Caffeine project.</div><div class=""><br class=""></div><div class="">Lawson</div>
<br class=""><div class="">
<div class=""><span style="font-family:Verdana,Geneva,sans-serif;font-size:12px;background-color:rgb(246,246,239)" class="">"Debugging is twice as hard as writing the code in the first place.</span><p style="margin-top:8px;margin-bottom:0px;font-family:Verdana,Geneva,sans-serif;font-size:12px" class="">Therefore, if you write the code as cleverly as possible, you are,</p><p style="margin-top:8px;margin-bottom:0px;font-family:Verdana,Geneva,sans-serif;font-size:12px" class="">by definition, not smart enough to debug it."</p><p style="margin-top:8px;margin-bottom:0px;font-family:Verdana,Geneva,sans-serif;font-size:12px" class="">-Brian Kernighan</p><p style="margin-top:8px;margin-bottom:0px;font-family:Verdana,Geneva,sans-serif;font-size:12px" class=""><br class=""></p></div><br class="m_3059700841316842135Apple-interchange-newline">
</div>
<br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">On Oct 12, 2017, at 11:18, Bert Freudenberg <<a href="mailto:bert@freudenbergs.de" target="_blank" class="">bert@freudenbergs.de</a>> wrote:</div><br class="m_3059700841316842135Apple-interchange-newline"></span><div class=""><div dir="ltr" class=""><span class=""><div style="font-family:arial,helvetica,sans-serif;font-size:small" class="">No, you have to put that test in the step method, because it has to be checked every time the position changes.</div><div style="font-family:arial,helvetica,sans-serif;font-size:small" class=""><br class=""></div><div style="font-family:arial,helvetica,sans-serif;font-size:small" class="">Or you have to wait until the animation is done before doing the test - it does work in your first example with my "hack". It does not work in the second example because the forked code is executed after that test (plus forking is bad for this anyways).</div><div style="font-family:arial,helvetica,sans-serif;font-size:small" class=""><br class=""></div><div style="font-family:arial,helvetica,sans-serif;font-size:small" class="">- Bert -</div></span><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Thu, Oct 12, 2017 at 7:39 PM, obrienj <span dir="ltr" class=""><<a href="mailto:obrienj@protonmail.com" target="_blank" class="">obrienj@protonmail.com</a>></span> wrote:<br class=""></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><div class="">The problem is that I want use something like (self position) >= (120@100) ifTrue: [self color: Color yellow] outside of the step method. Even though the morph moves, it's position remains unchanged and the boolean tests false. Hope this makes sense.<br class=""></div></span><div class="m_3059700841316842135HOEnZb"><div class="m_3059700841316842135h5"><div class="m_3059700841316842135m_-5740672471129903137protonmail_signature_block m_3059700841316842135m_-5740672471129903137protonmail_signature_block-empty"><div class="m_3059700841316842135m_-5740672471129903137protonmail_signature_block-user m_3059700841316842135m_-5740672471129903137protonmail_signature_block-empty"><div class=""><br class=""></div></div><div class="m_3059700841316842135m_-5740672471129903137protonmail_signature_block-empty m_3059700841316842135m_-5740672471129903137protonmail_signature_block-proton"><br class=""></div></div><div class=""><br class=""></div><blockquote class="m_3059700841316842135m_-5740672471129903137protonmail_quote" type="cite"><span class=""><div class="">-------- Original Message --------<br class=""></div><div class="">Subject: Re: [Newbies] Animation question<br class=""></div><div class="">Local Time: October 12, 2017 10:25 AM<br class=""></div><div class="">UTC Time: October 12, 2017 5:25 PM<br class=""></div><div class="">From: <a href="mailto:bert@freudenbergs.de" target="_blank" class="">bert@freudenbergs.de</a><br class=""></div><div class="">To: obrienj <<a href="mailto:obrienj@protonmail.com" target="_blank" class="">obrienj@protonmail.com</a>>, A friendly place to get answers to even the most basic questions about Squeak. <<a href="mailto:beginners@lists.squeakfoundation.org" target="_blank" class="">beginners@lists.squeakfoundat<wbr class="">ion.org</a>><br class=""></div><div class=""><br class=""></div></span><div class=""><div class="h5"><div dir="ltr" class=""><div class=""><span class="m_3059700841316842135m_-5740672471129903137colour" style="color:rgb(34,34,34)"><span class="m_3059700841316842135m_-5740672471129903137font" style="font-family:arial,sans-serif">On Thu, Oct 12, 2017 at 6:24 PM, obrienj </span></span><span class="m_3059700841316842135m_-5740672471129903137colour" style="color:rgb(34,34,34)"><span class="m_3059700841316842135m_-5740672471129903137font" style="font-family:arial,sans-serif"><<a href="mailto:obrienj@protonmail.com" target="_blank" class="">obrienj@protonmail.com</a>></span></span><span class="m_3059700841316842135m_-5740672471129903137colour" style="color:rgb(34,34,34)"><span class="m_3059700841316842135m_-5740672471129903137font" style="font-family:arial,sans-serif"> wrote:</span></span><br class=""></div><div class="gmail_extra"><div class="gmail_quote"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div class="">I am having difficulty getting the following example to work using either delay or step:<br class=""></div><div class=""><br class=""></div><div class="">aMorph := Morph new. <br class=""></div><div class="">aMorph position: (100@100).<br class=""></div><div class="">aMorph openInWorld. <br class=""></div><div class="">30 timesRepeat: [aMorph position: aMorph position +(1@0).
 Transcript show: 'test '; cr.]. <br class=""></div><div class="">(aMorph position) >= (120@100) ifTrue: [aMorph color: Color yellow].<br class=""></div><div class="">Transcript show: 'position: ', aMorph position; cr.<br class=""></div><div class=""><br class=""></div><div class="">For example:<br class=""></div><div class=""><br class=""></div><div class="">aMorph := Morph new. <br class=""></div><div class="">aMorph position: (100@100). <br class=""></div><div class="">aMorph openInWorld. <br class=""></div><div class="">delay := Delay forMilliseconds: 20.<br class=""></div><div class="">[30 timesRepeat: [aMorph position: aMorph position +(1@0). delay wait.].] fork. <br class=""></div><div class="">(aMorph position) >= (110@100) ifTrue: [aMorph color: Color yellow].<br class=""></div><div class="">Transcript show: 'position: ', aMorph position; cr.<br class=""></div><div class=""><br class=""></div><div class="">In the first example the morph moves, changes color, and the Transcript shows its final position. However, in the second example the morph moves but does not change color and the Transcript shows its starting position.<br class=""></div></blockquote></div></div><div class="gmail_extra"><br class=""></div><div class="gmail_extra"><div class="">Morphic animation is based on stepping. That means, you don't move a Morph repeatedly in a loop, but Morphic tells your morph to update its position repeatedly.<br class=""></div><div class=""><br class=""></div><div class="">You need to make your own Morph subclass and implement a "step" method. Whenever that method is called, it moves the morph by a little. For example, you could use an existing method called" translateBy:"<br class=""></div><div class=""><br class=""></div><div class=""><div class="">| aMorph |<br class=""></div><div class="">aMorph := Morph new openInWorld. <br class=""></div><div class="">aMorph startStepping: #transformedBy: at: Time millisecondClockValue arguments: {MorphicTransform offset: -3 @ -3} stepTime: 200.<br class=""></div><div class=""><br class=""></div><div class="">However, it's unlikely no existing method does your specific animation, so you indeed need to implement it, eg<br class=""></div><div class=""><br class=""></div><div class="">step<br class=""></div><div class=""><div style="color:rgb(34,34,34);font-family:arial,sans-serif" class="">    self position: self position + (1@0).<br class=""></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif" class="">    (self position) >= (120@100) ifTrue: [self color: Color yellow].<br class=""></div></div><div class=""><br class=""></div></div><div class="">So this is the Right Way. Without bad hacks you cannot do meaningful animation from a workspace. There is a hack however: If you insert "World doOneCycle" in the while loop of your first example, it will actually work, because it will redraw the world in each loop. However, this would prevent two objects animating independently, that's why the design calls for the "step" method approach.<br class=""></div><div class=""><br class=""></div><div class="">- Bert -<br class=""></div><div class=""><br class=""></div></div></div></div></div></blockquote><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></div>
______________________________<wbr class="">_________________<br class="">Beginners mailing list<br class=""><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank" class="">Beginners@lists.<wbr class="">squeakfoundation.org</a><br class=""><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank" class="">http://lists.squeakfoundation.<wbr class="">org/mailman/listinfo/beginners</a><br class=""></div></blockquote></div><br class=""></div><br class="">______________________________<wbr class="">_________________<br class="">
Beginners mailing list<br class="">
<a href="mailto:Beginners@lists.squeakfoundation.org" class="">Beginners@lists.<wbr class="">squeakfoundation.org</a><br class="">
<a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" rel="noreferrer" target="_blank" class="">http://lists.squeakfoundation.<wbr class="">org/mailman/listinfo/beginners</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
_______________________________________________<br class="">Beginners mailing list<br class=""><a href="mailto:Beginners@lists.squeakfoundation.org" class="">Beginners@lists.squeakfoundation.org</a><br class="">http://lists.squeakfoundation.org/mailman/listinfo/beginners<br class=""></div></blockquote></div><br class=""></body></html>