# What is the best way to add a seven day strike to my mobile game?

**URL:** <https://forums.unrealengine.com/t/what-is-the-best-way-to-add-a-seven-day-strike-to-my-mobile-game/443237>\
**Category:** UI\
**Tags:** windows-7, unreal-engine, Widget, question, Blueprint\
**Created:** [February 12, 2019, 3:22pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-add-a-seven-day-strike-to-my-mobile-game/443237 "2019-02-12T15:22:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2223cf9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2223cf9](https://forums.unrealengine.com/u/anonymous_user_b2223cf9)\
**Post date:** [February 12, 2019, 3:22pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-add-a-seven-day-strike-to-my-mobile-game/443237/1 "2019-02-12T15:22:33Z")

</div>

You know how in mobile games you have those bonuses is you play the game a weak in a row. I came up with this monstrosity (widgets and saving will be done later):

 ![268368-7-day.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/7/4/8747c958b58975166b71275cb06501a775f0bf4a.png)

And it goes on for 7 days.

Is it fine? Maybe (well, most likely) there is less autistic way to do it?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2223cf9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2223cf9](https://forums.unrealengine.com/u/anonymous_user_b2223cf9)\
**Post date:** [February 12, 2019, 3:34pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-add-a-seven-day-strike-to-my-mobile-game/443237/2 "2019-02-12T15:34:27Z")

</div>

I keep seeing flaws in this blueprint (what if this this is last day of the month? if you didn’t play for a day?) so help would be appreciated.

---

<div class="post-metadata">

**Author:** ![LNaej](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LNaej](https://forums.unrealengine.com/u/LNaej)\
**Post date:** [February 12, 2019, 8:43pm UTC](https://forums.unrealengine.com/t/what-is-the-best-way-to-add-a-seven-day-strike-to-my-mobile-game/443237/3 "2019-02-12T20:43:48Z")

</div>

I never used this “Today” API, but a simple algorithm like this one should work:

```
At first launch: StartDate = Today (variable must be saved)
                       Counter = 0 (variable must be saved)
Then, at each launch:
if ceil(Today - StartDate) != counter + 1 => reset as if first launch, because it means at least a day has passed without the game being launched.
else counter++ 
if counter == 6: the game has been launched each days for seven days. You can reset

```

Of course, if the game is not restarted, you need a way to detect that 24h passed since launch to do the “at each launch” part.
