The Daily Click ::. Forums ::. Klik Coding Help ::. Drawing a line between IDENTICAL POINTS... again
 

Post Reply  Post Oekaki 
 

Posted By Message

Battenburg



Registered
  24/04/2009
Points
  13
17th August, 2009 at 17:53:46 -

Yup.. me again being a big noob but I am determined to see this game to the very end! A while ago I had much help involving creating a scaling and alterable line that adjusts it length and angle to meet between two points (just draws a line between ActiveA and ActiveB).

But now I need help in figuring out how to create the line between object A and A, between two identical objects. The problem being me being new to MMF2 and can only handle basic loops and simple instances. So my basic question is

"Sqr(((X( "ActiveA" )-X( "ActiveB" )) pow 2)+((Y( "ActiveA" )-Y( "ActiveB" )) pow 2))"

How can the formula work with identical objects? I'm guessing it would be as simple as searching each one with it's own ID, but how would that work trying to locate the issued ID's within the formula? It's giving me a big headache...

All help very much obliged. I anything is unclear feel free to question.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
17th August, 2009 at 18:55:38 -

You just need to store the X and Y coordinates of the two objects, inside the Line object's alterable values.
That way, you can easily have multiple (duplicate) objects and lines.

I made a simple example here: http://cid-b1e7ee094271bbda.skydrive.live.com/self.aspx/Public/LineEg.mfa
It uses the ATan2 function, so make sure you open it in the non-HWA version of MMF2 (you can replace it with an angle extension if you prefer).

Edit: Apparently the new builds of MMF2-HWA *do* now support ATan2, so you can ignore that last bit

Edited by Sketchy

 
n/a
   

Post Reply



 



Advertisement

Worth A Click