Else fucntion expected ; error ?!!?

Non-platform specific questions.

Else fucntion expected ; error ?!!?

Postby kirby » Tue Mar 04, 2008 9:56 pm

Someone help us for just a sec'. Sorry i've been stop'ed makin' games. But i've start workin'..... Anyway.
How to use Else Function... Other's stuff with else funct' it works. But for meh, Isn't workin' anyway. When i type
else, and with teh vars, and others stuffes. And'en, there!! Pop up an error. Says
Code: Select all
Error Line  1: Expected ;

Gah!! What'en meaning????? I just tried everything, still popin' up each time i clickin' the ADD.
:| Surely can someone help'ittle? spitty... :)
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Else fucntion expected ; error ?!!?

Postby D.caaz » Tue Mar 04, 2008 10:18 pm

whats the code you're using? maybe i can help.
Current project
Space Battle(Back on track :) )
User avatar
D.caaz
 
Posts: 109
Joined: Tue Feb 19, 2008 6:42 am
Score: 4 Give a positive score

Re: Else fucntion expected ; error ?!!?

Postby kirby » Tue Mar 04, 2008 10:27 pm

Well... This'sit...
Code: Select all
if (slowmo == 0) slowmo = 1;
else if(slowmo == 1) slowmo = 0;


or

Code: Select all
slowmo = 0;
else slowmo = 1;


...Not workin', That give us error. Expected ;. Weird... :D
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Else fucntion expected ; error ?!!?

Postby pyrometal » Tue Mar 04, 2008 10:32 pm

Use this

Code: Select all
if(!slowmo)
{
    slowmo = 1;
}

else
{
    slowmo = 0;
}
SPRITE WARRIOR:
Free, open-source & crossplatform pixel art editor (currently under construction).
User avatar
pyrometal
 
Posts: 706
Joined: Wed Nov 28, 2007 4:07 am
Location: Kingston, ON, Canada
Score: 86 Give a positive score

Re: Else fucntion expected ; error ?!!?

Postby kirby » Tue Mar 04, 2008 10:42 pm

Hey... wait a minute... something wrong... yeah i know thanks for the code, it work. But i test my code... on the FIRST on i type.

Code: Select all
if (slowmo == 0) slowmo = 1;
else (slowmo == 1) slowmo = 0;


And this one workin' ????? :oops:
Maybe i just type something wrong on the code.
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron