How do I use the clock template to make a timer

benkhun21benkhun21 Member Posts: 19
edited April 2012 in Working with GS (Mac)
I need it to save the device timer once ( timestamp) , get a new time one min later, get the difference between the two numbers. and reset itself so it can do it 1 min later. ( this this where my problem is I think ) . any help is appreciated

Answers

  • MotherHooseMotherHoose Member Posts: 2,456
    when you ask for a new time one minute later … the difference will be one minute

    are you using the time to trigger an event?

    actorAttribute: self.myTime … real type
    1st behavior: changeAttribute: self.myTime To: self.Time

    Rule: when
    attribute: self.Time ≥ self.myTime+60
    -do this or that
    -changeAttribute: self.myTime To: self.Time

    "≥" because computerTime ticks in milliseconds … "+60" for 60sec/1 minute

    this demo uses selfTime and myTime to trigger spawns:
    http://www.mediafire.com/download.php?32suav885g8p0j6

    if you want a button touch to start the Time count action: have touch spawn a controlActor with the above rules/behaviors

    image MH
Sign In or Register to comment.