User Tag List

Results 1 to 4 of 4

Thread: add 1 to counter based on an objects y coordinate

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Oct 2010
    Location
    Hertfordshire
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    add 1 to counter based on an objects y coordinate

    Hi,

    Really simple one that is making me scratch my head for some reason.

    How do I add the current y coordinate of an object to a counter?

    e.g: if the object moves up add 1 for every pixel it moves up. If the object moves down minus 1 for every pixel it moves down.

    Anyone know the equation for this?

    Thanks in advance.

  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,782
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: add 1 to counter based on an objects y coordinate

    Set y position of active to 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 ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: add 1 to counter based on an objects y coordinate

    Not sure if I understand what you want exactly, but if you simply want to determine how many pixels you have moved every frame, you will probably need to store your previous YPos in a variable/counter and subtract your current YPos from that value. This will tell you how far you have moved. But this can be done in different ways depending on how you are moving your object.

    Mobichan

  4. #4
    mojofltr
    Guest

    Re: add 1 to counter based on an objects y coordinate

    mobichan nailed it.

    This is very useful for platform games; You can easily determine how much to reposition your character when it is riding a platform.

Similar Threads

  1. creating multiple objects based on value of a variable
    By infinitum3d in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd March 2013, 02:52 AM
  2. Placing objects based on a predefined shape
    By lembi2001 in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 5th July 2010, 09:41 AM
  3. Realtime Zoom based on distance between objects
    By Anders in forum File Archive
    Replies: 33
    Last Post: 14th June 2009, 11:23 AM

Posting Permissions

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