follow a graphic
Posted: Mon Jan 09, 2012 2:30 am
Hi Livecode Gurus,
I'm a new user to livecode, and hoping someone can point me in the right direction. I want to implement a 'follow' function that caters for intersecting. Say I have a card that has an image/graphic representing a wall. I can't run through the wall with my character so I user the intersect function to check where it is and handle it appropriately- simple enough. What I'm trying to do though is have an enemy chase my image - which again is simple enough using the loc of my image. But I'm having trouble in working out how the enemy can avoid the wall but still chase my character. If I use the intersect function again, I can stop the enemy before it hits the wall, but I can't work out how to best pick up the trail of my character and resume the chase.
Any tips would be appreciated!
Dave
I'm a new user to livecode, and hoping someone can point me in the right direction. I want to implement a 'follow' function that caters for intersecting. Say I have a card that has an image/graphic representing a wall. I can't run through the wall with my character so I user the intersect function to check where it is and handle it appropriately- simple enough. What I'm trying to do though is have an enemy chase my image - which again is simple enough using the loc of my image. But I'm having trouble in working out how the enemy can avoid the wall but still chase my character. If I use the intersect function again, I can stop the enemy before it hits the wall, but I can't work out how to best pick up the trail of my character and resume the chase.
Any tips would be appreciated!
Dave