How do I make REAL TIME EVENTS?

0 favourites
  • 6 posts
From the Asset Store
14 amazing sound files of game events like Level Ups, Level Completes, object spawn, object taking etc.
  • Hello everyone! time withouth posting here!

    i got a little question, is there a way to make a game to use real time? for example:

    i build a house, but it took 30 minutes to build.

    its there a way to turn off my phone, wait the 30 minutes and get back to play and see the house already builded??

    thanks!

  • Nothing will happen in your app when the phone is off. You can store the current clock time on exit (e.g. webstorage), then compare it with the time when it's restarted to see how much time has passed in the real world, and then do what you want.

  • Clash of Clans way (?)

    Well, you could do what codah told you to, but that would be insecure, as values would be saved (I think) on your phone and that would make it easy for somebody with good knowledge of programming, to change those values at will, and thus cheat

    What games like Clash of Clans do is keep up a server on another PC, that the device calls via the internet, to give it all the information about your houses and how much time they need to finish up building

    It is certainly possible in C2 via maybe Websockets, but that's a long story ... You might want to check out the manual on multiplayer servers and such

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I didn't see any mention of multiplayer or security But yeah that's a whole other thing.

  • codah

    Oh don't worry, it's all in there under the hood, just waiting to jump scare you with 500+ additionnal lines of code

    Trust me, i've been there and I coded that

  • Thanks a lot for the answers!

    i will start to read more about how to use websockets and multiplayer!

    cheers!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)