Right,... Very new to GS, just a quick Q from a newbie!

SaveDaveSaveDave Member Posts: 140
edited November -1 in Working with GS (Mac)
I have a really good idea for my first game. I'm the head of a graphic design dept of a publishing company so as far as design goes, I have this sorted.... My problem arises with my game I am setting out to make......

Is it possible to have a single timer running throughout my game even though my game changes to new screens for each "mini game" so to speak?..

Basically I want to time how long it takes for someone to complete a sequence...

Any help would be appreciated....

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    There is a running clock no matter what. It is game.time and it starts the moment the app is loaded. You can access it any time.

    EDIT: and it always runs even when you change scenes - it just keeps running until you close the app.
  • FatalCrestFatalCrest Member Posts: 113
    It is possible just that you'd actually have to use timer and for every second add 1 or so to some attribute that counts your time and then every time you switch scenes, to reset the time just set your time attribute to 0 or such.

    Create a real or integer attribute - Call it miniGameTimer or something

    then with your handy dandy Timer Behavior:

    Every 1 Seconds
    miniGameTimer = miniGameTimer + whatever amount your using(ex. 0.1, 1, 0.01)
  • FatalCrestFatalCrest Member Posts: 113
    or just do what scitunes said he has a better way Haha
  • SaveDaveSaveDave Member Posts: 140
    Thanks scitunes, however, can I create a clock that starts when you "start" the game and runs through these scenes and stops when you "finish"

    Ps. Sorry about the """"". It's the best way I can describe what I am trying to get across.
  • jstrahanjstrahan Member Posts: 498
    At start of play set attribute to game.time then just subtract that from current game.time to get time from start of play
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    yep. so it will look like this

    create an integer (if you are only concerned with full seconds) attribute called game.ClockOffset (or something like that).

    Then in the button that starts the game or even just in the first scene have a behavior that says

    change attribute game.ClockOffset to game.Time. Then All you need to do at anytime throughout the game is game.Time - game.ClockOffset and you will know how many seconds it has been since the person started the first scene.
Sign In or Register to comment.