Reset movePolygonal?

Create fast, sprite powered games with Animation Engine, co-developed with DerBrill Software!

Moderators: heatherlaine, kevinmiller, robinmiller, malte

Post Reply
hliljegren
Posts: 108
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Reset movePolygonal?

Post by hliljegren » Mon Mar 26, 2012 12:07 pm

Is there a way to reset the movePolygonal to ensure that it starts from a new path?

Here's my problem. Some of my students are doing a game where guards are patrolling along a path, but if the alarm sounds they should run according to a new path.
First we useed the folloing code (for the new path):

Code: Select all

set the movePolygonal["pointList"] of guard[1] to the loc of guard[1] & return & newPointList
But the movePolygonal seems to remeber which segment that is the "current" segment and starts animating from that segement on the new path.

Even if we reset the "isDistance" we get (alomost) the same result

what works most of the time is to do the following:

Code: Select all

set the movePolygonal["pointList"] of guard[1] to empty
send "movePolygonal" to guard[1]
set the movePolygonal["pointList"] of guard[1] to the loc of guard[1] & return & newPointList
But even then the object sometimes jumps from one location to another

So, is there any way to "reset" the movePolygonal to force it to start from scratch of the new path?
___________________________________
MacBook Pro, 15" 2.6GHz i7 Mac OS X 10.10.4
iMac 27", 3.2 GHz Quad i7, Mac OS 10.10.4
LiveCode 7.0.6 or 8.0dp4

hliljegren
Posts: 108
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Re: Reset movePolygonal?

Post by hliljegren » Mon Mar 26, 2012 12:38 pm

Uploaded a small example project. If you click the button once to start it and then another time after has moved more then half the distance of an "odd" segement you will see the "jump". I.e. the jump only occurs when the button has moved more then half the distance of an odd numbered segment.

Used LiveCode 5.5 and AnimationEngine 5.
Attachments
movePolygonal.livecode.zip
(1.28 KiB) Downloaded 450 times
___________________________________
MacBook Pro, 15" 2.6GHz i7 Mac OS X 10.10.4
iMac 27", 3.2 GHz Quad i7, Mac OS 10.10.4
LiveCode 7.0.6 or 8.0dp4

Post Reply

Return to “Animation Engine”