Making an app that will only work between the hours of 6pm and 6am...

LokitoesLokitoes Member, PRO Posts: 150

Just to double check, since I've never used this function before, do I do this with the 'device: clock' function? As I gather it is just pulling from the phone's clock time?

I've read a bunch of threads concerning the clock attribute but can't find any tutorial info in the cookbook - does anyone know if such a thing exists?

Cheers!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,937
    edited January 2019

    Yes and yes and I'm not sure.

    The OSTime Demo really helped me figure out things related to time and timers. I'm not sure it's still posted anywhere so here you go:

    https://www.dropbox.com/s/j8syqm7kggtu06e/OSTime Demo.gameproj.zip?dl=0

    The game.Clock.Hour attribute is in 24-hour format so you'd want to do something like this:

    When game.Clock.Hour ≥ 18 OR game.Clock.Hour ≤ 6
         [allow app to function]

    That's oversimplified since it doesn't take into account minutes but hopefully you get the idea.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.