Game Continue to Run Even When Not Visible?

Get help using Construct 2

Post » Sun Dec 01, 2013 5:56 am

Usually a Construct game pauses when the page has been switched out of or is not visible. I want my game to still run even when the Tab that it would be in is not visible, minimized etc. I was just wondering if someone could please tell me how I can set it in Construct that my game still runs even when it the player does not have page visibility.
B
5
Posts: 3
Reputation: 183

Post » Sun Dec 01, 2013 6:30 am

There's no way to do this with exported projects AFAIK.
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sun Dec 01, 2013 8:44 am

Oh, that's a shame. I was trying to make a clicker game similar to that of Cookie Clicker, Candy Box or Clicking Bad. Without this function the idea is worthless, and Construct was the only game engine that I could find that was easy to use and had all the functions I required for this sort of game. I even took ages figuring out if I could do everything I needed like upgrades etc. Everything was going to work, and I even made a prototype that worked with everything (just not fancy), which was when I discovered this problem. This is really upsetting
B
5
Posts: 3
Reputation: 183

Post » Sun Dec 01, 2013 8:53 am

I think the only possible way around it that someone discussed was to use a plugin from rexrainbow that calculates how much system time has elapsed since you were last on the tab and then update your stats to reflect this. Not sure if that is ideal for your game though, maybe!
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sun Dec 01, 2013 8:57 am

I use layers. so game still runs in background no problem. Each layer is a new tab. I use it for my settings, options, screens etc. When they switch to those tabs it sets game layer visibility to 15 - 30% depending and puts layers visibility to 90 - 100%.

So you never change layouts unless you want to.

Obviously, I don't understand what you mean by tabs. But you can cycle layers without stopping game flow. Game is built upon layers after all.
DUTOIT2013-12-01 09:01:16
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Sun Dec 01, 2013 9:19 am

@DUTOIT I think he's referring to switching between tabs in the web browser.
B
45
S
15
G
73
Posts: 2,002
Reputation: 43,386

Post » Sun Dec 01, 2013 9:31 am

Lol, thanks plinkie for clearing that up. A game that continues to play without a player - Um????

Edit: Will have to edit exported project.
http://candies.aniwey.net/Press F12 and view source You going to need to insert code into the exported project. Have a look at main.php should have answer. Or possibly a js file.
----
Its sunday morning -
Or possibly pull in data (current time when browser not suspended - time when browser was suspened and added that to variable cookies) via ajax from users pc clock. DUTOIT2013-12-01 11:45:56
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,708

Post » Sun Dec 01, 2013 3:37 pm

Just set "Pause on unfocus" to No in the project properties

Edit: my bad, I forgot that's only for preview. Indeed, using the Browser plugin with the "on suspended" and "on resumed" triggers, you can compare how much time has elapsed between the two events.OlivierC2013-12-01 15:44:48
B
12
S
5
G
2
Posts: 132
Reputation: 2,627

Post » Mon Dec 02, 2013 6:04 am

[QUOTE=plinkie] I think the only possible way around it that someone discussed was to use a plugin from rexrainbow that calculates how much system time has elapsed since you were last on the tab and then update your stats to reflect this. Not sure if that is ideal for your game though, maybe![/QUOTE]

I suppose that I could try out the plugin, if that's the last resort I have. Where can I get it and how do I install it for my game?
B
5
Posts: 3
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests