[etoys-dev] Forward direction (was Re: First draft of Etoys Reference Manual Glossary)

Steve Thomas sthomas1 at gosargon.com
Tue Sep 25 23:08:34 EDT 2012


Edward,

I think you may have uncovered a bug (although it may exist in the model
inside my head).

I can take a polygon from the Supplies flap and it starts out with its
heading and forward direction as 0.
Then if I first change the forward direction to 180 and then change the
heading to 0 (which also changes the forward direction to 0) I wind up with
the polygon costume turned 180, but heading and forward direction both 0.
 This does not make sense to me.

Also the Balloon help for "heading" states: "Which direction the object is
facing. 0 is straight up"
The Balloon help for "forward direction" states: "The angle of my forward
direction without rotating myself"

Okay, so I may be starting to get this but it seems harder than it should
be.

To my simple mind, there are two things:

   1.   the rotation of the costume, where its "original" value is 0 (ie:
   straight up) (Seems like this should map to "heading" but my case above
   provides a counter example.
   2.   the "forward direction" which is the direction it will move in.


Thus changing forward direction should not IMNSHBOWO change heading.
Of course at this point we probably do not want to change existing behavior
which could break old projects. So we may have to document as is.

Stephen
IMNSHBOWO - In My Not So Humble But Often Wrong Opinion


On Tue, Sep 25, 2012 at 7:08 PM, Edward Mokurai Cherlin <
mokurai at sugarlabs.org> wrote:

> On Tue, September 25, 2012 12:56 pm, karl ramberg wrote:
> > On Mon, Sep 24, 2012 at 8:49 AM, Edward Mokurai Cherlin
> > <mokurai at sugarlabs.org> wrote:
>
> >> forward direction: What effect or use does it have?
> >
> > Each player has a direction arrow that can be changed by clicking on
> > it while holding shift.
> > If it's not visible you can check the box 'direction arrow' in halo menu.
> > When you tell a player to move forward it will move in the direction
> > of the arrow.
>
> This turns out not to answer the question I asked. You are describing
> the heading, not the forward direction.
>
> Objects move in the direction of their heading, which is the direction
> of the Halo arrow, but not necessarily the same as the forward
> direction. Rotating the Morph with the Rotate handle in the Halo
> changes the heading but not the forward direction. Turning on the
> direction arrow, and then grabbing it with a shift-click and turning
> it, changes both the forward direction and the heading. These two
> values can be edited in the viewer as well. Editing the heading leaves
> the forward direction unchanged. Editing the forward direction also
> changes the heading. The command Object forward by 5 moves the Morph
> in the heading direction. I see nothing in Etoys that makes use of the
> forward direction.
>
> In Squeak, we see for the Morph class:
>
> heading
>         "Return the receiver's heading (in eToy terms)"
>         owner ifNil: [^ self forwardDirection].
>         ^ self forwardDirection + owner degreesOfFlex
>
> forwardDirection: newDirection
>         "Set the receiver's forward direction (in eToy terms)"
>         self setProperty: #forwardDirection toValue: newDirection.
>
> degreesOfFlex
>         "Return any rotation due to flexing"
>         "NOTE: because renderedMorph, which is used by the halo to set
> heading, goes down through dropShadows as well as transformations, we
> need this method (and its other implems) to come back up through such
> a chain."
>         ^ 0.0
>
> and so on.
>
> Also in Squeak, I see 19 senders of forwardDirection in 12 classes,
> which I do not feel ready to explore until after I learn rather more
> Squeak and Smalltalk. I can feel it coming on. ^_^
>
> --
> Edward Mokurai (默雷/निशब्दगर्ज/نشبدگرج) Cherlin
> Silent Thunder is my name, and Children are my nation.
> The Cosmos is my dwelling place, the Truth my destination.
> http://wiki.sugarlabs.org/go/Replacing_Textbooks
> _______________________________________________
> etoys-dev mailing list
> etoys-dev at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/etoys-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/etoys-dev/attachments/20120925/884811c4/attachment.html>


More information about the etoys-dev mailing list