game ala 'ogame' example

Get help using Construct 2

Post » Fri Apr 05, 2013 10:19 pm

I wonder how do something like that:
i set counter variable (100) and every minute substract 1.
But even if i close game/browser/PC game are still be working, so if i turn of game for one hour and i launch i see 40 of this variable.delgado2013-04-06 13:15:53
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Apr 06, 2013 11:52 am

bump
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Apr 06, 2013 12:08 pm

You'll need a server with required functionality that runs the game logic. It's stuff that will get complicated quickly, and C2 might not be the most optimal tool for that sort of project. You could have an interface created in C2 that communicates with the server, which does most of the heavy lifting and calculations.

Edit: Just for the clock functionality, you could use AJAX/PHP to communicate with some service and grab a time stamp. But for true multiplayer you'd need a server.vee412013-04-06 12:10:12
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Sat Apr 06, 2013 12:34 pm

There may be a simpler way by reading the PC's clock - but this will be able to be cheated very easily.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Sat Apr 06, 2013 1:06 pm

@vee41 i dont look for multiplayer just singleplayer game So what server i need? dropbox is good or other free hosting? i need working this offline acuallydelgado2013-04-06 13:16:24
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Sat Apr 06, 2013 2:11 pm

@delgado I think the only way then to do this is offline is to read the computer's clock. I don't think you can do this with vanilla C2, but there is a third-party plugin. (I'm not sure if it's out of date).

What you'd need to do is save the time before closing it, then saving it to webstorage, then when starting up compare the time now and the old time.

Unfortunately this can be easily cheated by changing the time.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: Lof and 4 guests