Page 1 of 1

Playtiime function

PostPosted: Sat May 16, 2009 6:00 am
by Hblade
I've developed a function that allows you to view the seconds, minutes, and hours of gameplay for your games. It's easy to use. First, put this in the Global Code.
Code: Select all
int seconds;
int minutes;
int hours;
int countframes;
void PlaytimeFunction()
{
    countframes = countframes + 1;
    if (countframes == 30)
    {
        countframes = 0;
        seconds = seconds + 1;
    }
    if (seconds == 60)
    {
        minutes = minutes + 1;
        seconds = 0;
    }
    if (minutes == 60)
    {
        minutes == 0;
        hours = hours + 1;
    }
}

Then, make an actor. Have that actor use the function PlaytimeFunction();. Make 3 text actors. For the first actor, have it's textNumber be seconds. For the second actor, minutes, and for the third actor, hours. Heres a demo showing you how to do this.

Re: Playtiime function

PostPosted: Sat May 16, 2009 6:38 am
by sillydraco
interesting! there's all kinds of things you could use this for!