How do I add 1 score point when my app is off ?

0 favourites
  • 14 posts
From the Asset Store
Connect the dots in the correct order and draw happy animals!
  • How count and add/ substract one point to/from global variable when my app is turned off?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm not sure that is possible, what's your goal?

  • I'm not sure that is possible, what's your goal?

    its adding score when you dont play, ( but when you play you have possibility to gain more score)

  • Check out the Time Away plugin:

    You can use it to check how long the app was inactive and award a number of points depending on this time.

  • Check out the Time Away plugin:

    You can use it to check how long the app was inactive and award a number of points depending on this time.

    i dont understand 'date in a row'

    capx example dont display anything

  • maxwell88

    Capx example displays everything in Browser's console log. Press F12 in the browser, you'll see.

    As I understand, you need to do this:

    Every time your game starts, load Timestamp from local storage. Paste today's date, save timestamp to local storage (AsJSON).

    To get the number of days in a row your app was played, use DateInARow.ContinuousCount( ) expression.

  • maxwell88

    Capx example displays everything in Browser's console log. Press F12 in the browser, you'll see.

    As I understand, you need to do this:

    Every time your game starts, load Timestamp from local storage. Paste today's date, save timestamp to local storage (AsJSON).

    To get the number of days in a row your app was played, use DateInARow.ContinuousCount( ) expression.

    What i should put in 'set text' in text object? to display in layout?

  • If you are talking about sample capx from this page, just replace "Browser Log" with "Text set text"

  • If you are talking about sample capx from this page, just replace "Browser Log" with "Text set text"

    ok i have this, but why text object shows me

    ''4.05.2015, 00:00:00: 0''

    and nothing happen

    just display this date only?

  • It's a demo...

    It adds this date to a timestamps and shows how many days in a row the app was running - "0"

    Then it adds another date and the number of days changes to "1".

    You will need to add a real date to the timestamp, every time your app starts.

  • It's a demo...

    It adds this date to a timestamps and shows how many days in a row the app was running - "0"

    Then it adds another date and the number of days changes to "1".

    You will need to add a real date to the timestamp, every time your app starts.

    i try add latest date and also add today date, nothing happen

  • And what do you expect to happen?

    Here is a demo:

    https://www.dropbox.com/s/m61bf4o4tclbj ... .capx?dl=0

    Run it.

    Change the date on your PC to tomorrow's date.

    Run again.

    Change the date on your PC to the day after tomorrow's date.

    Run again.

    Change the date on your PC to next week date.

    Run again.

  • And what do you expect to happen?

    Here is a demo:

    https://www.dropbox.com/s/m61bf4o4tclbj ... .capx?dl=0

    Run it.

    Change the date on your PC to tomorrow's date.

    Run again.

    Change the date on your PC to the day after tomorrow's date.

    Run again.

    Change the date on your PC to next week date.

    Run again.

    hmm maybe counting from date to date? ok i wil try, thanks

  • It's not possible, but you can fake it as dop2000 suggested. But, you don't need a plugin for this

    Get the time and date at regular intervals while game is being played and save in local storage ( every minute or so, because you don't know when a player will quit the game ).

    Then, the next time game is started get the time and date as soon as it starts, then load the last time and date saved in local storage, and subtract that from this new date. Then just award number of points per each minute, hour of difference, whatever your want. Of course you will need to convert time and date to hours or minutes, depending on what you want to use as your unit of measurement

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)