Click in polygon
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Click in polygon
yes lots of programming. If it knows where it starts. it knows where it ends. but it can not pass through objects in its way with no predefined path then it will be tonnes of coding
Re: Click in polygon
Not tons!
If it's objective is to get from the left of the screen to the right with a box in the center then when the avatar hits the box it can be as simple as;
x- 1 --back away from box
y + 1 --move down
x+ 1 --hits box? if yes repeat the above
Now if the box is a U on it's side and the avatar walks into it then it does get more complicated. But I didn't get the impression that the link you posted was to a game but a moving storybook? Maybe I have it all wrong?
Simon
If it's objective is to get from the left of the screen to the right with a box in the center then when the avatar hits the box it can be as simple as;
x- 1 --back away from box
y + 1 --move down
x+ 1 --hits box? if yes repeat the above
Now if the box is a U on it's side and the avatar walks into it then it does get more complicated. But I didn't get the impression that the link you posted was to a game but a moving storybook? Maybe I have it all wrong?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Click in polygon
Hi all,
Da_Elf, Simon's current answer/solution is better for your problem.
But to let you know that it is not your fault that your first script didn't work:
With LC 6.6.5 this would have worked "closely", with LC 6.7 to 7.0 it currently reports more than half of cases wrong.
See my post in ( http://forums.livecode.com/viewtopic.php?f=7&t=22042 ).
Da_Elf, Simon's current answer/solution is better for your problem.
But to let you know that it is not your fault that your first script didn't work:
With LC 6.6.5 this would have worked "closely", with LC 6.7 to 7.0 it currently reports more than half of cases wrong.
See my post in ( http://forums.livecode.com/viewtopic.php?f=7&t=22042 ).
shiftLock happens
Re: Click in polygon
the link i gave was to a game engine for making one of the old school point and click adventure games like kings quest. The movement of the character in their engine uses an AI system so things like walking into a U wouldnt happen. In my little search on google im coming across some pathfinding tutorials but they are for different coding platforms. Going to jump into reading some of this tomorrow
http://bjoernke.com/?target=games
http://bjoernke.com/?target=games