x2495iiii
10-25-2009, 05:03 PM
Add a "when a variable changes" event which calls a method with an if/else if statement that checks the score to see if it's a certain value, and calls the method you want when it is that certain value.
BigOrangeArmy
10-25-2009, 05:17 PM
Hello :). It took a while to figure, out but I think I have it. Say you want to, for example, make the sky go black whenever you reach a score of five.
(BTW, if you dont want to read all of this, just download my example program and run it. It'll speak for itself :cool:)
First, create a number variable equal to 1.
Second, we need to make your methods. In order for your score to increase, you need to have your method triggered, which can be used with an If/Else statement. If you want your score to increase with every second that an object, say, touches another object, use a While statement.
In other words:
***********
(If) Object1 is within 5 meters of Object2
(While) Object1 is within 5 meters of Object2
increment World.Score by 1 (duration can be whatever)
(Else)
Nothing
***********
Third, you should create a method that makes the sky go black. This is easily done:
*****
//Method Screen.Black:
world set atmosphereColor to (Black)
*****
And finally, you should create another While event that says in essence:
***********
"While World.Score >= 5 is True,
Begin world.ScreenBlack
***********
In essence, when this script is run, it will make your score go up 1 for every second your Object1 is within 5 meters of Object2. One the score hits 5, the screen will go black. Of course, you can change the ScreenBlack method to anything you want.
Hope that helps!