User Tag List

Results 1 to 4 of 4

Thread: How to count how many times object passes a certain point?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Adnihil's Avatar
    Join Date
    Oct 2016
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to count how many times object passes a certain point?

    Hey, I'm using the movement extension 'Circular' to have an active object orbit around a point. Now what I'd like to do is count how many times the object has made a complete circle. Is there an easy way to do this?

  2. #2
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Maybe use an Active object and a counter. Every time the object collides with the active add 1 to the counter.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    665
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    You change the center of the Circular Movement dynamically or something?
    Otherwise you can simply set the desired X/Y coordinates of the Active object and then use a value/counter.

    You can also get the same X/Y coordinates of the object with the center of the circle:
    For example you can use an object and the hotspot is the center of the circle.

    Int(X( "center" ) + 50 * Cos(Starting Angle)) = 257
    Int(Y( "center" ) + 50 * Sin(Starting Angle)) = 235
    → Add 1 to Counter
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Adnihil's Avatar
    Join Date
    Oct 2016
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nivram View Post
    Maybe use an Active object and a counter. Every time the object collides with the active add 1 to the counter.

    Marv
    Oh, of course! That works great, thanks! I had been using custom movements so much that I forgot about collision detection :p

    Quote Originally Posted by Wodjanoi View Post
    You change the center of the Circular Movement dynamically or something?
    Otherwise you can simply set the desired X/Y coordinates of the Active object and then use a value/counter.

    You can also get the same X/Y coordinates of the object with the center of the circle:
    For example you can use an object and the hotspot is the center of the circle.

    Int(X( "center" ) + 50 * Cos(Starting Angle)) = 257
    Int(Y( "center" ) + 50 * Sin(Starting Angle)) = 235
    → Add 1 to Counter
    Thanks, but this does not work for higher speeds. For example if you set Spd to 10 and Angular Velocity to -500, the counter will (almost) never go up.

Similar Threads

  1. Count number of times a frame has restarted?
    By MrHost56 in forum Fusion 2.5
    Replies: 2
    Last Post: 16th August 2015, 07:41 AM
  2. Replies: 1
    Last Post: 11th August 2015, 07:14 AM
  3. Count number of times a number appears
    By Hydra in forum Fusion 2.5
    Replies: 3
    Last Post: 13th October 2014, 05:13 PM
  4. Everything passes through Backdrop
    By Exploder1010 in forum File Archive
    Replies: 2
    Last Post: 5th August 2011, 11:48 PM
  5. Newgrounds count vs. mochi count
    By Tuna in forum SWF/Flash Export Module Version 2.0
    Replies: 9
    Last Post: 20th September 2010, 08:37 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
  •