User Tag List

Results 1 to 5 of 5

Thread: Fast loop for adjusting the angle of a line

  1. #1
    Clicker Multimedia Fusion 2 DeveloperAndroid Export Module

    Join Date
    May 2010
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fast loop for adjusting the angle of a line

    In the game I'm making the player can use the cursor to push a line left or right that extends from the center of a circle (like pushing the arms of a clock).

    Note of clarity: the angle of the line does not follow the cursor.

    Right now I have:

    If Cursor is overlapping Zone1 Then Set Angle of "Line" to (Angle of "Line")+5

    If Cursor is overlapping Zone2 Then Set Angle of "Line" to (Angle of "Line")-5

    This results in the angle of the line jumping 5 pixels left or right as opposed to actually MOVING 5 pixels left or right. I figure I need a fast loop to accomplish this, but I've only ever made fast loops for gravity and so I don't exactly know how to make one for this.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Re: Fast loop for adjusting the angle of a line

    + Cursor overlaps Zone1
    -> Start fastloop "RotateL", 5 times.

    + On loop "RotateL"
    -> Line: Set Angle to Angle("Line") + 1

    + Cursor overlaps Zone2
    -> Start fastloop "RotateR", 5 times.

    + On loop "RotateR"
    -> Line: Set Angle to Angle("Line") - 1

    Or you could run a fastloop 10 times, rotating by 0.5 degrees on each loop, if you needed greater precision.
    The line will still appear to instantly jump 5 degrees, but you can check for collisions etc in between.

    If you want it to rotate smoothly, you don't need fastloops.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperAndroid Export Module

    Join Date
    May 2010
    Posts
    163
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fast loop for adjusting the angle of a line

    Okay, well collisions don't matter for the line at all, I just need it to rotate smoothly, how would I do that without a fast loop?

  4. #4
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    195
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Fast loop for adjusting the angle of a line

    Just use a value to make it repeat x number of times.

    Something like;

    +Cursor overlaps zone1
    ->Set Val A to 5

    +Cursor overlaps zone2
    ->Set Val A to -5

    +Val A > 0
    ->Set angle to angle+1
    ->Set Val A to Val A-1

    +Val < 0
    ->Set angle to angle-1
    ->Set Val A to Val A+1

    //EE

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Fast loop for adjusting the angle of a line

    You could use the WaitFor object and "Limit to X loops" condition in conjunction with the "Set Loop Limit" action.

Similar Threads

  1. Instead of Fast Loop
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 5th November 2010, 04:08 AM
  2. fast loop and loop index
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th May 2010, 01:43 AM
  3. Fast loop within fast loop - platform game
    By Safe in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 16th April 2010, 07:38 AM
  4. fast loop
    By jhonson in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th November 2008, 09:18 PM
  5. Fast Loop - How do you use it?!
    By jonjoyceuk in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 31st May 2008, 02:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •