Is this possible?

Hi all.
I wanted to add this to my game and wanted to know if it was even possible with GS

Essentially, I wanted the game to add a life to the players total but importantly, while the game is switched off - like Candy Crush does with a timer.

Can anyone throw some light on this?

Comments

  • TheGabfatherTheGabfather Member Posts: 633
    You can use the device's time.
    You can access it via Devices > Clock > (Year, Month, Day, Hour, Minute, Second, Millisecond)

    Work out the math depending on your metrics, then implement Saving and Loading of Attributes.

    Like in Candy Crush though, this can be cheated by altering your device's system time.

    Watch this video.
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited September 2013
    This will convert a time to a very basic timestamp, but won't take into account that timestamps start from 1970 odd, and not all months containing 31 days which is why the number is much higher than a unix timestamp, but it should give you a basic one to work with for your game.

    game.Clock.Second +( game.Clock.Minute *60)+( game.Clock.Hour *60*60)+( game.Clock.Day *60*60*24)+( game.Clock.Month *60*60*24*31)+( game.Clock.Year *60*60*24*31*12)

    Add it to a display text behaviour and you'll see it increment every second.

    With this you can subtract the two timestamps to see how many seconds between each time and therefore how many hours between each time, while also using the the load and save attribute @TheGabfather mentioned.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    There is a template created by @tatiang for this. Search the forum.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited September 2013
    Thanks, Dave @FryingBaconStudios. The template's available here: http://gshelper.com/shop/gamesalad-templates/tamagotchi-virtual-pet-template. You can also use the file I uploaded here to create your own, but it's going to take some work: http://forums.gamesalad.com/discussion/comment/389325/#Comment_389325.
Sign In or Register to comment.