Idle game issue.

Get help using Construct 2

Post » Wed Aug 05, 2015 6:22 pm

I want to use the wallclock time everytime i want to change a tab in the browser.
im making this to once the player switches to the game tab, the amount of currency he could earn while idle will be directly proportional to the amunt of time he was afk.
¿how do i do that?
¿is there any event that can make that happend?

(i apologise for my english)
B
5
S
1
Posts: 28
Reputation: 490

Post » Wed Aug 05, 2015 9:03 pm

Every 1.0 seconds
- - Add to "currency": 1

Make sure you set "Pause on unfocus" to 'no' in the Configuration Settings subsection of the Project Properties.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Thu Aug 06, 2015 9:37 pm

@gumshoe2029 you do realize that "Pause on unfocus" is an option that works only on preview and not on export, right?
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Fri Aug 07, 2015 2:14 am

@shinkan @gumshoe2029
i want to solve this problem:
Image
but it just simply doesnt work.
every time i change tabs the game still freezes the gold.
And if i remove the Every 1 Second from the event, it will literally raise 60 times per second
B
5
S
1
Posts: 28
Reputation: 490

Post » Fri Aug 07, 2015 4:30 am

Up-
Please help me someone.
B
5
S
1
Posts: 28
Reputation: 490

Post » Fri Aug 07, 2015 10:26 am

@Grim there's plenty of posts on the forum about that. All you need to do is to use search.

And not to be rude or anything, but maybe you should read some tutorials or make something simpler first. Looking at your events it's quite obvious that you have no idea what are you doing.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Fri Aug 07, 2015 10:37 am

Events are completely suspended when the game is in the background. You probably want to use the Browser object's 'On suspended' and 'On resumed' triggers. If you save the wallclocktime in both, you can figure out how long the game was in the background for, and compensate accordingly.
Scirra Founder
B
398
S
236
G
88
Posts: 24,441
Reputation: 194,671

Post » Fri Aug 07, 2015 8:06 pm

shinkan wrote:@Grim there's plenty of posts on the forum about that. All you need to do is to use search.

And not to be rude or anything, but maybe you should read some tutorials or make something simpler first. Looking at your events it's quite obvious that you have no idea what are you doing.

You would be surprised of what i'm actually archieving...

Thanks @Ashley.
B
5
S
1
Posts: 28
Reputation: 490

Post » Fri Aug 07, 2015 9:09 pm

There is a difference between knowing what and how to do something and achieving something. But like I said, I didn't want to be rude and have no intention in that.
I would be surprised if you had troubles with achieving something, because It's rather difficult to not achieved anything with C2 events :D

Unfortunately what i wrote in previous post stands correct. And again, I'm not being rude or anything. You should take few steps back and read and especially learn how to use events properly. When you understand that you will notice right away how nice and smooth you can use events into your advantage.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343

Post » Sat Aug 08, 2015 5:34 pm

shinkan wrote:@gumshoe2029 you do realize that "Pause on unfocus" is an option that works only on preview and not on export, right?


We use it on our exported game atm. It seems to work?

But then we don't care how long the user is not focused on our client. We just want everything to keep ticking off.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, dand, tinhofiel and 26 guests