User Tag List

Results 1 to 6 of 6

Thread: Counter question

  1. #1
    No Products Registered

    Join Date
    Jun 2007
    Posts
    323
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Counter question

    Sorry my math skills are awful :\ I'm trying to make a point system where my player gets a 1-UP for every 10,000 points gained. What expression do I use for this?

  2. #2
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,062
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Counter question

    a method i always use for this is this:

    whenever a score is added (to counter or score)
    also have a counter used to track hiscores, and add it here too.
    so each time add the score gained to both counters; or score & counter.

    then check hiscore counter >10,000 and subtract 10,000 and add a life.
    the score will stay as normal adding up all the time. its the hiscore that you keep checking with.

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Counter question

    Always set lives to score mod 10000

  4. #4
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,062
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Counter question

    i see mod used now and then. i still dont understand exactly how it works - sounds silly, but mod didnt exsist when i was at school.
    ive tried to look it up, but i get examples etc, which looked garbled to me.. yeah im not a bright spark
    can someone explain it in "simpleton" terms :P

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Counter question

    Jacob has the right idea using mod, but the wrong expression

    Using mod, I recommend:

    Score MOD 10000 = 0
    - Add 1 to lives

    Explanation of MOD: MOD gets the remainder from a division

    eg. if 10001 mod 10000 (What's the remainder from 10001/10000)?
    - remainder is 1, therefore not 0, so don't add a life

    if 20000 mod 10000 (remainder from 20000/10000)
    - remainder is 0, therefore add a life

    Jacob's expression just changes the lives to the remainder... therefore lives always match the score until it reaches 10000, then it goes back to 0. Not exactly useful for a lives counter, but he was on the right track.

    You'll also need to use a flag so it doesn't loop over and over again for the same score.
    eg.

    Score MOD 10000 = 0
    AND Score is not equal to Previous_Life_Added_At_Score
    - Add 1 to lives
    - Set Previous_Life_Added_At_Score to Score

    However, using MOD introduces the problem that if the score isn't incremented by 1 then it could skip the new life entirely (eg. if you add 7 to the score, instead of 1). The first reply is probably a better way to work around this problem.

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    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)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,062
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Counter question

    O_o see you've just confirmed my thoughts.

Similar Threads

  1. Counter question
    By KLiK-iT in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 14th June 2012, 11:23 AM
  2. Counter question.
    By GameDragon in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd November 2010, 02:07 AM
  3. Alterable Value & Counter question
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th April 2008, 04:50 PM
  4. Counter Question
    By gamefreak202 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th November 2007, 06:18 PM
  5. Request/Question. Selected object counter.
    By Dines in forum Extension Development
    Replies: 4
    Last Post: 21st September 2006, 10:13 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
  •