User Tag List

Results 1 to 8 of 8

Thread: Help with and expression for extra lives

  1. #1
    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)

    Help with and expression for extra lives

    My game is score based and extra lives are earned every 50000 points. I have been trying to figure out how to only trigger one extra life every time the player crosses the threshold of 50000 point intervals. Since the player can earn different amounts of points in the game, they may not land on exactly 50000 points.

    Can someone offer an expression to detect when a score hits 50000? I was thinking PlayerScore Mod 50000 = 0, but that will only return true if the score lands on 50000 exactly. And I am trying to find one expression that fits all, so I don't want to code different score ranges if possible.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with and expression for extra lives

    I cannot give you an expression, but here is what I would do.

    Make a new counter and set its initial value to 1. Name it NumberOfAddedLives.
    Then put in this event:

    * Score / 50000.0 > NumberOfAddedLives
    - NumberOfAddedLives: add 1 to current value
    - Add 1 to lives

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with and expression for extra lives

    Start of Frame
    - set NextLiveCounter to (score( "Player 1" )/50000)*50000+50000

    Player score >= NextLiveCounter
    - add 1 live
    - set NextLiveCounter to (score( "Player 1" )/50000)*50000+50000

    I suck in maths, so there might be a smarter formula. However, this one works fine.

  4. #4
    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: Help with and expression for extra lives

    Thanks so much Popcorn. It must be getting late as my brain has turned to mush and I can't even come up with something as simple as that.

  5. #5
    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: Help with and expression for extra lives

    Popcorn: did you mean to say set the counter to 1 initially? That would mean the event won't fire until the player score reaches 100000.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with and expression for extra lives

    Quote Originally Posted by mobichan
    Popcorn: did you mean to say set the counter to 1 initially? That would mean the event won't fire until the player score reaches 100000.
    Yes I did mean that and it works.

    Say you have 51000 points.
    51000 / 50000.0 = 1.02
    1.02 > 1
    You gain an extra life

  7. #7
    Clicker Multimedia Fusion 2iOS Export Module

    Join Date
    Jul 2006
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help with and expression for extra lives

    Quote Originally Posted by Popcorn
    * Score / 50000.0 > NumberOfAddedLives
    I am having trouble figuring out how to put the above line into the expression editor or make a condtion out of it.

    Please excuse me for my ignorance, but I would sincerely appreciate some help on getting this to work. I'm sure it's quite simple! :grin:

  8. #8
    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: Help with and expression for extra lives

    You need to use a "Compare 2 General Values" expression. It is under the Special icon.

Similar Threads

  1. How to use extra fonts?
    By EdibleWare in forum SWF/Flash Export Module Version 2.0
    Replies: 0
    Last Post: 23rd December 2013, 04:39 PM
  2. Tetris with extra features
    By steamer in forum Multimedia Fusion 2 - Technical Support
    Replies: 28
    Last Post: 16th April 2013, 11:37 AM
  3. Making extra levels
    By Robin_Manager in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 27th September 2008, 08:19 PM
  4. extra attacks
    By dray in forum Multimedia Fusion 2 - Technical Support
    Replies: 20
    Last Post: 4th September 2008, 10:59 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
  •