Playtiime function

You must understand the Game Editor concepts, before post here.

Playtiime function

Postby Hblade » Sat May 16, 2009 6:00 am

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.
Attachments
playtimedemo.zip
(45.99 KiB) Downloaded 132 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Playtiime function

Postby sillydraco » Sat May 16, 2009 6:38 am

interesting! there's all kinds of things you could use this for!
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest