Search Unity

How to earn certain amount of money in under X amount of seconds, With high score

Discussion in 'Scripting' started by shootluckgaming1, Dec 9, 2018.

  1. shootluckgaming1

    shootluckgaming1

    Joined:
    Dec 9, 2018
    Posts:
    2
    I want to add this little side mini game to my Clicker, where you have to earn X amount of money in X amount of seconds, and it shows your high score and saves it until you beat it, can someone help me with this?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,775
    What have you tried?
     
  3. Lelefant

    Lelefant

    Joined:
    Jul 1, 2015
    Posts:
    22
    I think this could be realized with a queue. You can enqueue any earning and then check if the oldest elements in the queue are still inside the given time frame. If they are older than X seconds, they have to be dequeued. When you dequeued all old earnings, you can iterate over the queue and sum up all earnings.
     
  4. shootluckgaming1

    shootluckgaming1

    Joined:
    Dec 9, 2018
    Posts:
    2
    I havent tried anything yet, because I have no clue how to even go about it
     
  5. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,775
    At this point, I may only suggest to start from basics.
    See Learn section.
    Because I wont know, what you know already and what don't.