Alice Community  

Go Back   Alice Community > Alice 2 > Bugs and Troubleshooting

Thread Tools Display Modes
Prev Previous Post   Next Post Next
Problem with "move toward" in conjunction with "distance to"
Posts: n/a
Default Problem with "move toward" in conjunction with "distance to" - 06-06-2008, 05:24 PM

In attempting to do all of the problems I'm assigning to students this summer, I encountered the following problem.

1. Add a dragon and a blimp to the world.
2. Turn the dragon to face the blimp.
3. Move the dragon toward the blimp, the distance between the dragon and blimp.

The problem occurs in step 3. If the amount to move is blimp->distance to dragon, the results are as expected. However, if the amount to move is dragon->distance to blimp, the dragon moves through and past the blimp, such that he ends up about as far away as he started (just on the opposite side of the blimp). It seems that the order in which the objects are presented to the "distance to" function affects the result.

Have I misinterpreted how "move toward" or "distance to" is supposed to work? It would be nice to be able to explain to students why this discrepancy occurs or to confirm this is a bug.

I've attached the problematic code, which includes comments about the starting and ending coordinates of the blimp and the dragon for both cases. I have not yet tested to see whether all objects behave this way, or if it is just the dragon and the blimp.
Attached Files
File Type: a2w BuggyWorld.a2w (1.70 MB, 154 views)
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.