Timer problems

Jaws206Jaws206 Member, PRO Posts: 19

Hello,

Could someone please help me out with a timer problem? I have a timer set up for my levels, but the timer does it own thing.

I would like the timer to start when I press start and stop when the level is over or when my main actor loses all of its 3 lives.

Thanks,
Gerard.

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    @Jaws206

    Hello Gerard, without any idea of your programming solution so far, it's difficult to troubleshoot, as there will be variations as to how you'd approach what you're after.

    However, one way: you'll want something along the lines of:

    In your Start button:

    Rule: When touch is pressed
    Rule (nested in above, set to Any): When Start = 0 or Start = 2
    Change attribute Start to 1
    
    Rule: When Start =1
    Timer: Every 0.1 seconds
    Change Attribute LevelTime to LevelTime+0.1
    
    Rule: When LevelFin is true
    Change attribute Start to 2
    

    And in an actor displaying the time:

    Display Text LevelTime

    P.S Make sure the attribute LevelTime is real if you want divisions of seconds to show as well.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Jaws206Jaws206 Member, PRO Posts: 19

    Hello gyroscope,

    Sorry for the delay in responding as I’ve been working on the information you gave me. Sorry to say but it didn’t work as the timer stayed at zero, thanks for trying.
    Gerard.

  • colandercolander Member Posts: 1,610

    @Jaws206 upload a test project and someone should be able to get it going for you.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    Hi again @Jaws206 As @colander recommends, it'd be helpful to see a test project to gauge your angle on what you're after.

    Still, I've made a small test file which will hopefully be useful for you. It's closer to what you're after this time around... my suggestion above wasn't quite right for you (although I'm not sure why you couldn't get the time to work - still, that's irrelevant now)...

    So here's that test file for you to look at and hopefully "weave" into your game...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    *** bump ***

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Jaws206Jaws206 Member, PRO Posts: 19

    Hello gyroscope,

    Sorry I didn’t get in touch as shift work makes me into a zombie, first of all I didn’t know what a test thingy was till I downloaded the one you put together.

    Any way I gave your test thingy a good look over and I understand the “Start” bit, but I don’t know where to put the “simulate end of level and “simulate no lives left”.

    I was going to upload a test of my game mechanics for you to look at and see if you can make head or tail of my set up.

    I tried to upload my file but I got a message saying I can not upload more than 20 files at once, So I’m stuck I don’t know what to do now.

    My end goal is to get the timer to stop when my gun player loses a life, which is for 1 second or more, or when I press the pause button and start up when in game play or I un-pause the game.

    Thanks,
    Gerard.

  • colandercolander Member Posts: 1,610

    Did you compress your test file before uploading it? I won't upload if you don't.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    @Jaws206

    Hi Gerard, those two buttons marked simulation are just that - to simulate when you've used a Change Attribute behaviour to end the game, or When you have your lives attribute becoming zero and so triggering it to stop, both in your actual game.

    So I didn't mean for you to include those in your game -they are there for testing purposes for you; does that make sense?

    As @colander says, make sure your test file is compressed before uploading... I'lll take a look and see how to "weave in" my example into your game file for you when you've uploaded it.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Jaws206Jaws206 Member, PRO Posts: 19

    Thanks guys, I feel like a right dunderhead here’s the compressed file

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited June 2014

    @Jaws206

    Hi again - here's your test game file amended for you. I've added the Timer section as required, and tweaked throughout, including making the Lives start at 3 and to go down as they're lost - this is the usual way...

    I'm sure it's quite straightforward for you to compare to see all of the changes.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • Jaws206Jaws206 Member, PRO Posts: 19

    Thanks gyroscope,

    I can see the amended sections and timer, the lives bit I didn’t know how to do that. Thanks for fixing it for me; I’m going to go to the garden to do some cartwheels.
    Thanks again,
    Gerard.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    You're welcome, Gerard. :smile: You were that pleased you did cartwheels? Excellent! :smiley:

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.