A timer that resets every xxx seconds

3absh3absh Member Posts: 601
edited July 2015 in Working with GS (Mac)

Hey guys, I'm making a kind of unusual game,
-The idea here is that there's a rotating 1 hand clock that starts at the 6 o'clock position at the beginning of the game
-Rotation of clock hand is constrained with the DayCountdown attribute
-Clock hand should rotate twice a.m and p.m till next day starts (when DayCountdown=0 , dayCount = dayCount+1)
-Days get longer depending on dayCount attribute, they Increase 50 seconds everyday
-Time goes faster permanently when certain accessory is collected, so as the player progresses in the game the clock hand should spin very fast at the beginning then slow down with every passing day (since days increase in time 50 seconds)


Reason for 180 is because the initial hand position was towards 12 o'clock


Daynumber-1 because initial value of Daynumber was 1 and we want an increase of 50 seconds for each day


When countdown reaches 0 dayNumber increases by 1 and countdown for following day increases by 50 seconds

Comments

  • tintrantintran Member Posts: 453
    edited July 2015

    shouldn't your constraint rotation be something like
    180 - (DayCountDown/(100+(DayNumer-1) * 50)) * 720?
    since you want it rotate twice per day (720 degrees) and it's dependent upon current DayCountDown divided by the total DayCountDown that was initially set?
    and since you're interpolating DayCountDown downto zero counting downward
    it's probabably 180+ (... to rotate clockwise
    instead of 180 - (... which rotates counter clockwise when counting down.
    try it out,
    maybe your goal is to rotate counter clockwise. not sure.

  • 3absh3absh Member Posts: 601

    @tintran said:
    shouldn't your constraint rotation be something like
    180 - (DayCountDown/(100+(DayNumer-1) * 50)) * 720?
    since you want it rotate twice per day (720 degrees) and it's dependent upon current DayCountDown divided by the total DayCountDown that was initially set?
    and since you're interpolating DayCountDown downto zero counting downward
    it's probabably 180+ (... to rotate clockwise
    instead of 180 - (... which rotates counter clockwise when counting down.
    try it out,
    maybe your goal is to rotate counter clockwise. not sure.

    Check this out


    Countdown setting


    Contrain setting

  • 3absh3absh Member Posts: 601

    The 1 handed clock is rotating counter clockwise as I needed, but I'm facing a small problem, when the hand spins twice and reaches the 6am position again (start of day) the countdown resets to 25, I don't know where this 25 came from

  • 3absh3absh Member Posts: 601

    I added a new attribute and named it countdown duration, I hope this works :)

  • 3absh3absh Member Posts: 601

    With this setting everything seems to be going good, except that the clock isn't resetting at the 6am position. I'm gonna look into it right now

  • 3absh3absh Member Posts: 601


    Clock Setting
    It works beautifully

  • tintrantintran Member Posts: 453

    @abuabed84 said:

    Clock Setting
    It works beautifully

    glad you got it worked out.

Sign In or Register to comment.