I have successfully created a system for path-finding in Construct 2 for my game Luna. Whereas the second player can successfully follow you through the level with ease. However, I need help optimizing the code. The method I use utilizes a lot of IF statements since I cannot hard code a reference to an instance variable. This method will be of interest to a lot of people I am sure.
The theory that I exercised was that by using a series of quadrants and then measuring the distance to Player1 and Player2 you could read the direction of how to get to the quadrant that is nearest Player1 by reading the instanced direction from the quadrant closest to Player 2 (Similar in theory to a DNS lookup)... Well this worked splendidly!, but I just need help optimizing the IF statements.. so that I don't have to use a bunch of IFs. Thanks for looking and enjoy using this method I created in your own projects!
<font color="RED">I have commented the code where I need help. ( UPDATE 11.29.2012 SOLVED! )</font>
Download Gillis CAPX Example File <- My original file
Download R0J0hound optimized CAPX Example File
<font color="BLUE">Watch the Female Character for an example of my Quadralant Path-finding in use!</font>
[TUBE]http://youtu.be/Q76_-8xWVOs[/TUBE]
Thanks for looking
Dan