Community

SCI Programming => SCI Syntax Help => Topic started by: jtyler125 on January 14, 2007, 12:58:57 AM

Title: How to put up a good screen to say "You've won game"?
Post by: jtyler125 on January 14, 2007, 12:58:57 AM
Once the person has reached a certain score what alerts them that they have won the game.

I image a statement like:

(if score = 69)
(Print "You've done it you are the winner.")

but I am dumb...what are your suggestions.

My game is 99% done for the competition...just putting in winner script...with your guys help of course.
Title: Re: How to put up a good screen to say "You've won game"?
Post by: Cloudee1 on January 14, 2007, 05:04:19 AM
Well, it's a common theme right now, but using a doit method you probably could get away a statement like that. Granted the one you typed isn't in the right order but the jist is right. And a display might be better, a print statement will go away if I hit enter, but the display will stick around.

Code: [Select]
(if (== score 69) // I'm not sure what the score variable is called exactly
 (Display "You've done it you are the winner.")
)

Or instead of a print or display, you could just go to an entirely different room. One that says congratulations or you won or whatever. Maybe try your hand at using a changestate method and making some sort of animations. 
Title: Re: How to put up a good screen to say "You've won game"?
Post by: jtyler125 on January 14, 2007, 08:49:10 AM
More homework...crap.  I will try it, but I was kind of all giddy being 99% done.  We will see.
Title: Re: How to put up a good screen to say "You've won game"?
Post by: Doan Sephim on January 14, 2007, 10:58:58 AM
Hey great job! Can't wait to play the games for the competition.
Title: Re: How to put up a good screen to say "You've won game"?
Post by: jtyler125 on January 14, 2007, 11:59:32 AM
Ok does anyone know what the score variable should be if my main.sc is the standard main.sc?  Just trying to add in Cloudee1's code for ending the game once you reach a certain score.

So far I've tried:
the original...
(if (== score 2) // I'm not sure what the score variable is called exactly
 (Display "You've done it you are the winner.")
)

below ar emy variations...
(if (== Score) // I'm not sure what the score variable is called exactly
 (Display "You've done it you are the winner.")
)

(if (== (Score 2) // I'm not sure what the score variable is called exactly
 (Display "You've done it you are the winner.")
)

(if (== (gScore 2) // I'm not sure what the score variable is called exactly
 (Display "You've done it you are the winner.")
)
Title: Re: How to put up a good screen to say "You've won game"?
Post by: Cloudee1 on January 14, 2007, 01:30:47 PM
gMaxScore
Title: Re: How to put up a good screen to say "You've won game"?
Post by: jtyler125 on January 14, 2007, 08:32:52 PM
Ok this is what finally worked...and it took hours to get these little lines tweaked out to work...sorry I had to go with the good old print line instead of display.

(if(== gScore 12)
Print ("You've done it you are the winner.")

Thnaks,
Cloudee1
Title: Re: How to put up a good screen to say "You've won game"?
Post by: Cloudee1 on February 14, 2007, 05:36:11 PM


(if(== gScore 12)

But you see, if 12 is the maximum score. Then when you set it for displaying on the menubar, you actually set the gMaxScore. So your if statement should have been.

(if(== gScore  gMaxScore)

Or even better would be is equal to or greater than, just in case you wanted to add in a couple of hidden points.