Page 1 of 1

Timer Question

PostPosted: Sat Apr 17, 2004 2:30 am
by Just4Fun
How do I track a timer's count?

I have created a periodic timer that repeats 30 times. I want to disable a mouse down event when the timer reaches its last count of 30.

I know this is easy but my brain is refusing to help. :oops: :oops:

TlA

PostPosted: Sat Apr 17, 2004 4:32 am
by makslane
Create a new variable to track this count.
On timer event, use something like this:

timerCount = timerCount + 1;

PostPosted: Sat Apr 17, 2004 2:47 pm
by ingsan
Hi :)

On your TimerActor (ASCII or bitmap) :

Add Event CreateActor
Add Action Script and write :
    int timerCount =30;
    Create Timer(yourTimer);

Add Event Timer
Add Action Script and write :
    timerCount--;

Add Event Draw Actor
Add Action Script and write :

    if(timerCount<0)
    {
    DisableMouseDownAction;
    }
or
    if(timerCount==0)
    {
    DisableMouseDownAction;
    }


i always use this code and it works well :wink:
See you :mrgreen:

PostPosted: Sat Apr 17, 2004 3:16 pm
by jazz_e_bob
consider your code stolen :wink:

jazz

PostPosted: Sat Apr 17, 2004 4:49 pm
by Just4Fun
ingsan,
Once again, you saved my day. :) Thank you. I really do need to see the steps in order to make sense of things. Your complete listing of the code helps me so much.
The only place I got a little confused was that I needed to set up the "timerCount" as a global variable. Once I figured that out, everything went perfectly.
I may have another simple little demo ready before long.
Everyone is so helpful here. I'm actually even learning some of the scripting! :D

PostPosted: Sat Apr 17, 2004 7:33 pm
by ingsan
i'm happy to help, guys :) Really