Problem setting conditions of function.

Talk about making games.

Problem setting conditions of function.

Postby bat78 » Mon Feb 10, 2014 10:25 am

img0.png
img0.png (5 KiB) Viewed 1410 times


function:
Code: Select all
int f_timer(int f_seconds)
{
    int frame;
    frame++;
 
 
    if (frame >= f_seconds*30) { return 1; }
    else { return 0; }
}


obj1:
Code: Select all
int i = f_timer(5);
if (f_timer(5) == 0) ExitGame;


add:
img.png
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Problem setting conditions of function.

Postby DarkParadox » Mon Feb 10, 2014 6:15 pm

ExitGame is a function, you need to use:
Code: Select all
if (f_timer(5) == 0) ExitGame();
User avatar
DarkParadox
 
Posts: 457
Joined: Mon Jan 08, 2007 11:32 pm
Location: USA, Florida.
Score: 84 Give a positive score

Re: Problem setting conditions of function.

Postby bat78 » Mon Feb 10, 2014 6:53 pm

LOL misstype of brackets when picking from the list.
I was like "Thats fake error, my script have nothing to do with the error e-e" wasn't concentrated at something else but the function.
Thanks.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest