Multiple If....

Non-platform specific questions.

Postby Game A Gogo » Tue Nov 28, 2006 1:10 am

Game A Gogo wrote:make it
Code: Select all
if(score<200)

not
Code: Select all
if{score<200}

if thats not it, then i must be blind, (its hard to see because of the BG of the window)


ok, just took a closer look, and they are ( ) and not { }, sorry.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Diana Kennedy » Tue Nov 28, 2006 7:00 am

Oh, my head smokes...Okay, I will try out the last.

And as for the question "score" is the actors name that displays the score. A text actor.

Thank you so much for looking into this.
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby Fuzzy » Tue Nov 28, 2006 7:38 am

Thats it! you have to say (score.textNumber > 500)
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Game A Gogo » Wed Nov 29, 2006 12:03 am

Diana Kennedy wrote:Oh, my head smokes...Okay, I will try out the last.

And as for the question "score" is the actors name that displays the score. A text actor.

Thank you so much for looking into this.

yeah, what he says.
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Diana Kennedy » Sat Dec 23, 2006 12:21 am

Still struggling with this.

Now I tried this code:

Code: Select all
if (score.textNumber>=3000)
CreateActor("platin", "platin", "(none)", "(none)", -47, -49, true);


else if (score.textNumber<3000)
CreateActor("gold", "gold", "(none)", "(none)", -47, -49, true);

else if (score.textNumber<2000)
CreateActor("tin", "tin", "(none)", "(none)", -47, -49, true);


It works with the platin and the gold medal, but not for the tin. gold is displayed when tin should come.

To remember: "score" is a text actor...
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Postby Game A Gogo » Sat Dec 23, 2006 12:27 am

use this code insted:
Code: Select all
if (score.textNumber>=3000)CreateActor("platin", "platin", "(none)", "(none)", -47, -49, true);


else if (score.textNumber<3000 && score.textNumber<2000)CreateActor("gold", "gold", "(none)", "(none)", -47, -49, true);

else if (score.textNumber<2000)CreateActor("tin", "tin", "(none)", "(none)", -47, -49, true);
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby makslane » Sat Dec 23, 2006 12:45 am

Code: Select all
...
else if (score.textNumber > 2000 && score.textNumber < 3000)
{
  CreateActor("gold", "gold", "(none)", "(none)", -47, -49, true);
}
...
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Game A Gogo » Sat Dec 23, 2006 12:55 am

oh, sorry, my bad :x
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Diana Kennedy » Sat Dec 23, 2006 10:32 pm

Hm... I well, I tried:

Code: Select all
if (score.textNumber>=3000)CreateActor("platin", "platin", "(none)", "(none)", -47, -49, true);

else if (score.textNumber > 2000 && score.textNumber < 3000)
{
  CreateActor("gold", "gold", "(none)", "(none)", -47, -49, true);
}

else if (score.textNumber<2000)CreateActor("tin", "tin", "(none)", "(none)", -47, -49, true);


It now works for the tin medall and the platin buut not for the gold. Tin comes even when score higher than 1000
User avatar
Diana Kennedy
 
Posts: 257
Joined: Wed Dec 07, 2005 12:34 am
Location: France, where Presidents who got shot in Texas do exile ;-)
Score: 0 Give a positive score

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest