User Tag List

Results 1 to 8 of 8

Thread: Run in background/ run while app is unactive?

  1. #1
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jan 2014
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Run in background/ run while app is unactive?

    So I have a question... In games like cookie clicker where you get "5" cookies per second, how would you keep the numbers going even if the app is terminated or in the background? Thanks!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jul 2010
    Location
    Belgium
    Posts
    244
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could save the moment the player leaves the app in an INI, using the Date&Time object, and retrieve the time when you launch the app again. Figure out how much time has past and give cookies accordingly.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Norway
    Posts
    325
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To have your program to run when minimized or hidden, go to Application setting and click on "Runtime Options" and check "Run while minimized". You can also have the program completely hidden by using "Window Control" extension.

    For the second question, mickarrow's idea is probably the best. Have the Date&Time object, and then store the time when you close the application. When you start it again, check how many seconds ago since you closed it and then give a cookie per 5 seconds since you closed it.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,275
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's poor practice to have your app hidden in the background, you can in theory minimise to tray on exit by overriding the exit button to minimise instead of exit and use the tray object.
    Condition: Special - Application Menu - Close Window has been selected?
    - Window control extension: minimise

    Mickarrow's idea is perfect because it doesn't use up any of your computer's processing power when the app is not running.

  5. #5
    Forum Moderator

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleMac Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Perry's Avatar
    Join Date
    Dec 2013
    Location
    Watertown, WI
    Posts
    4,355
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    "Condition: Special - Application Menu - Close Window has been selected?"

    is this valid for Android / IOS ? Thought Application Menu was only for Windows Applications.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleXNA Export Module

    Join Date
    Jan 2013
    Location
    Collogne
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mickarrow View Post
    You could save the moment the player leaves the app in an INI, using the Date&Time object, and retrieve the time when you launch the app again. Figure out how much time has past and give cookies accordingly.
    How do you do that exactly?
    I think it is getting very difficult when the month has different amount of days (29/30/31)

    Thanks for help

  7. #7
    Clicker Fusion 2.5 (Steam)
    FalconsoftIndustries's Avatar
    Join Date
    Aug 2017
    Location
    Mandurah Western Australia
    Posts
    118
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Perry View Post
    "Condition: Special - Application Menu - Close Window has been selected?"

    is this valid for Android / IOS ? Thought Application Menu was only for Windows Applications.
    Should be possible.

  8. #8
    Clicker Fusion 2.5Fusion 2.5 Mac
    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)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    787
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    All of these games save your last played date and time (sometimes down to the second), and when you start it back up it calculates the amount of time that has passed by comparing the stored value to the current time. Then it calculates how much gold/cookies you should have recieved. Cookie clicker, idle heroes etc all do this.

Similar Threads

  1. Replies: 3
    Last Post: 26th January 2014, 07:18 PM
  2. Background
    By WareWolff in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 2nd July 2010, 04:49 PM
  3. 2d background..
    By PsySpooky in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 3rd June 2007, 02:27 AM
  4. Background
    By Bogeyman in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 25th February 2007, 06:33 PM
  5. Setting Static Text Background to MDI Background
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th September 2006, 04:17 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
  •